Repair of corrupted catalogs

Tomiron

New Member
Joined
May 28, 2012
Messages
3
Location
Sweden
Lightroom Experience
Advanced
#1
Trying to open a corrupt catalog of mine makes LR freeze forcing me to kill the actual LR-process to proceed. I also need to delete the preference files to start LR again. It is not possible to import any data from the corrupted catalog to a new one. (My latest backup catalog works just fine though, but lacks quite a few hours of work...)

Is there by any chance a way to check integrity or do any other kind of catalogue repair of corrupted catalogs that doesn't open in LR? If I'd been more of a tech-pro I'd might been successful in using sqlite3 or sqlite analyzer to check the database. Now is that not the case..

I'm aware of that holding down the Alt-key (on Win) or Opt-key (on Mac) while simultaneously clicking on the LR icon in the dock cause LR to open but not to open the default catalog. Instead it shows a dialog with a list of available catalogs and an option to create check integrity of each catalog. In my case - this doesn't work. If I choose my corrupted catalog following this procedure this will still cause LR to crash.

Working in LR 4, Win7 64 bit, 4GB RAM, accessing catalog and previews from an external drive, images stored on a multiHD-NAS.
 

b_gossweiler

Senior Member
Joined
Jun 19, 2009
Messages
3,207
Location
Zurich, Switzerland
Lightroom Experience
Advanced
#2
Welcome to the forums, Tomiron, sorry to hear a corrupt catalog leads you to this place.

A few things to try:
  1. Create a fresh, new catalog, and try importing the trouble catalog into it.
  2. If it does not work, do the same but import the trouble catalog in smaller pieces into it.
  3. If it does not work, you could email your catalog (just the *.lrcat file, it zips quite well), and I can try just vacuuming it with SQLite.
  4. If that doesn't work, then there's Dan Tull at Adobe, who is the catalog specialist and might be able to repair.

If option 1 or 2 work for you:
  • If you're satisfied with the catalog as it is (i.e. if you didn't use published services which will not be imported), you could replace your corrupt catalog by the new one
    (replace means rename the corrupt catalog, copy the new catalog to the same location and name it the same as the corrupt catalog was named before)
  • If you'd rather base your further work on the backup catalog, you could replace the corrupt catalog by a backup, open the backup and then import from catalog those parts (dates) which are not present in the backup yet.
    (replace means rename the corrupt catalog, copy the backup catalog to the same location and name it the same as the corrupt catalog was named before)

Beat
 

Brad Snyder

Senior Member
Joined
Nov 20, 2007
Messages
6,293
Location
Port Deposit, Maryland USA
Lightroom Experience
Intermediate
#3
I think Dan may not be directly connected to the Lr team now.

http://twitter.com/#!/dantull

But he's always been a very nice guy about this kind of stuff as a last resort. I'm sure Victoria will know all the skinny.... including a direct email address. (I could guess, but I can't find it in my archives anywhere_
 

Tomiron

New Member
Joined
May 28, 2012
Messages
3
Location
Sweden
Lightroom Experience
Advanced
#4
First of all - thanks for your replies!

A few things to try:
  1. Create a fresh, new catalog, and try importing the trouble catalog into it.
  2. If it does not work, do the same but import the trouble catalog in smaller pieces into it.
  3. If it does not work, you could email your catalog (just the *.lrcat file, it zips quite well), and I can try just vacuuming it with SQLite.
  4. If that doesn't work, then there's Dan Tull at Adobe, who is the catalog specialist and might be able to repair.

Beat
1. Tried with no sucess.
2. How is this done? I don't get any options and at any attempt LR crashes.
3. Much appreciated! Got so interested in this action myself, that I'd like to figure it out for any upcoming needs. Downloaded SQlite3 and tried the actions described here. But my programming skills stops att Basic level as I can't get SQlite to start. What do I get wrong when I, in the Command prompt write: "echo.dump | sqlite3 TOJA.lrcat > TempTOJA.sql" where TOJA is the name of my corrupted catalog? Get the following message: "Error: incomplete SQL: dump"

/T
 

Victoria Bampton

Lightroom Queen
Staff member
Administrator
Moderator
Lightroom Guru
Joined
Sep 29, 2007
Messages
20,424
Location
Southampton, UK
Lightroom Experience
Power User
Lightroom Version
CC Cloud
#5
Yep, he's moved to another team, but last time I talked to him, he was still quite happy to help out when people are really stuck. He doesn't get many any more, as he did a load of work on the fixing and prevention. His email was [email protected] is the other tricks don't work though.
 

b_gossweiler

Senior Member
Joined
Jun 19, 2009
Messages
3,207
Location
Zurich, Switzerland
Lightroom Experience
Advanced
#6
This command is exactly the approach I would have take to vacuum the catalog.

What do I get wrong when I, in the Command prompt write: "echo.dump | sqlite3 TOJA.lrcat > TempTOJA.sql" where TOJA is the name of my corrupted catalog? Get the following message: "Error: incomplete SQL: dump"
You need to enter a space between echo and .dump

Beat
 

Tomiron

New Member
Joined
May 28, 2012
Messages
3
Location
Sweden
Lightroom Experience
Advanced
#7
That's right, Beat! The space is significant... :)


Went further and managed to start the SQlite cleaning. Got so far as exporting the lrcat to a new sql-file. When trying to bring the data back to a new lrcat-file things start to act funny for me. Initially it all seemes to work. I can see how a new file is being built up right up to about the size of my 1,6 GB original file. SQlite also brings out the attached message concerning drawbacks in the catalog. But right when the process is finished the new lrcat-file is emptied. The file is still there, but with no content and no size....
Got in contact with Dan who kindly offered his assistance. A lot of helpful souls out there!
I'll post back.
/Tomas

SQlite message cleaning lrcat-file.JPG
 

b_gossweiler

Senior Member
Joined
Jun 19, 2009
Messages
3,207
Location
Zurich, Switzerland
Lightroom Experience
Advanced
#8
Tomas,

At least you learnt something on the way here :)

The messages indicate an inconsistency in your catalog, obviously the catalog contains rows with non-unique primary keys, which is invalid in a table. I guess SQLite is backing out the load because of these errors.

I'm pretty confident Dan will be able to fix the issue for you.

Beat
 
Last edited:

Eden

New Member
Joined
Aug 25, 2012
Messages
1
Lightroom Experience
Intermediate
#9
I recently experienced the same problem. I've been looking for any solution on the web. I have no experience with coding. Would you be willing to try vacuuming it with SQLite for me?
 

Victoria Bampton

Lightroom Queen
Staff member
Administrator
Moderator
Lightroom Guru
Joined
Sep 29, 2007
Messages
20,424
Location
Southampton, UK
Lightroom Experience
Power User
Lightroom Version
CC Cloud
#10
Hi Eden, welcome to the forum!

Tell us more about the problem you're having? And are you really on LR2.0? Updating to 2.7 (last free update) would be worthwhile as they added some extra catalog repair code in along the way.
 
Joined
May 25, 2012
Messages
38
Location
Outside Boston, MA
Lightroom Experience
Intermediate
Lightroom Version
#11
Last edited by a moderator:

geecom

New Member
Joined
Dec 17, 2012
Messages
3
Lightroom Experience
Advanced
#12
Hi all

Another victim of a bust catalog. I've successfully dumped the LR catalog, but when I run the init command, it seems to have just frozen.

Command prompt output is:
C:\Store\Lightroom\Corrupt>echo .dump | sqlite3 catalog.lrcat > recovered.sql


C:\Store\Lightroom\Corrupt>sqlite3.exe -init recovered.sql Catalog.lrcat
-- Loading resources from recovered.sql

Its been like this for a couple of hours now, and going by the last modified stamp on recovered.sql, nothing further has been written to the file either.

Any recommendations gratefully received.
 

Victoria Bampton

Lightroom Queen
Staff member
Administrator
Moderator
Lightroom Guru
Joined
Sep 29, 2007
Messages
20,424
Location
Southampton, UK
Lightroom Experience
Power User
Lightroom Version
CC Cloud
#13
Hi geecom, welcome to the forum!

Any backups you could use? If not, I have a contact at Adobe who should be able to help, but it would likely be after the holidays now.
 

geecom

New Member
Joined
Dec 17, 2012
Messages
3
Lightroom Experience
Advanced
#14
Hi geecom, welcome to the forum!
Thanks!

Any backups you could use? If not, I have a contact at Adobe who should be able to help, but it would likely be after the holidays now.
As ever, whilst under a week apart, the differences between the current catalog and backup are fairly substantial.

Partial good news though - by renaming and then opening the broken catalog, Lightroom actually loaded it. I could then even change its name back to the original, and it still works. However, if I try to optimize or backup, the task ultimately fails, and then Lightroom refuses to open the catalog again. Quite peculiar!

Unless anyone has any suggestions, I fear a contact at Adobe may be my only help.
 

Victoria Bampton

Lightroom Queen
Staff member
Administrator
Moderator
Lightroom Guru
Joined
Sep 29, 2007
Messages
20,424
Location
Southampton, UK
Lightroom Experience
Power User
Lightroom Version
CC Cloud
#15
Try creating a clean catalog, and then going to file > import from another catalog and import that one in. If it still fails, you may find that you can import a chunk at a time to narrow down where the issue's occurred.
 

geecom

New Member
Joined
Dec 17, 2012
Messages
3
Lightroom Experience
Advanced
#16
Try creating a clean catalog, and then going to file > import from another catalog and import that one in. If it still fails, you may find that you can import a chunk at a time to narrow down where the issue's occurred.

The lovely Dan managed to fix the catalog - something wrong with a metadata index table. Thanks for all your help!
 

Victoria Bampton

Lightroom Queen
Staff member
Administrator
Moderator
Lightroom Guru
Joined
Sep 29, 2007
Messages
20,424
Location
Southampton, UK
Lightroom Experience
Power User
Lightroom Version
CC Cloud
#17
Excellent, I'm really pleased to hear it!
 
Joined
May 13, 2009
Messages
60
Location
Arizona, USA
Lightroom Experience
Intermediate
Lightroom Version
Classic 7
#18
Also Having Catalog Issues

I, too, am having difficulties with what I believe to be corruption in my Lightroom catalog. The symptom is that I cannot publish images to Facebook using the furnished Lightroom plug-in. Everything I have read tells me that this is caused by a corrupt catalog file.

I'd like to resolve this problem.

Do you recommend that I start with a first step of creating a new catalog file and attempting to import my current lrcat file into the new one?

Mac OS X 10.8.2; Lightroom 4.3.

Thanks very much,

Stan
 

clee01l

Senior Member
Staff member
Moderator
Lightroom Guru
Joined
Jun 20, 2009
Messages
13,921
Location
Bellaire, TX USA
Lightroom Experience
Power User
Lightroom Version
Classic 7
#19
I, too, am having difficulties with what I believe to be corruption in my Lightroom catalog. The symptom is that I cannot publish images to Facebook using the furnished Lightroom plug-in. Everything I have read tells me that this is caused by a corrupt catalog file.
Stan what would lead you to believe this is a corrupt catalog. What messages are you getting when you attempt to Publish to FB?
 
Joined
Mar 17, 2013
Messages
9
Lightroom Experience
Intermediate
#20
Hi, I been using LR for over a year and backing up every 2 weeks. However for a while LR gets stuck on "testing Integrity" and so I have been cancelling it lately. Today, quite accidentally I clicked on a backup version of lightroom to see what it loads, when I realised it loads what it saved at that time. I shut down and tried to open my normal LR cat file. Now it comes up that the file needs to be repaired. (Although I have been loading LR just fine before) I tried to fix, but to no avail. I then tried to load a couple of months of backups and they are ALL corrupt! (This must have been why I was getting stuck on the testing integrity part) I tried doing something that was suggested on this forum: making a new cataloque and then importing the catalogue, but this message popped up: "The catalog does not appear to be a valid Lightroom catalog." Is there anything I can do? Much appreciate any help!
 
Joined
Apr 25, 2013
Messages
2
Lightroom Experience
Beginner
#21
Welcome to the forums, Tomiron, sorry to hear a corrupt catalog leads you to this place.

A few things to try:
  1. Create a fresh, new catalog, and try importing the trouble catalog into it.
  2. If it does not work, do the same but import the trouble catalog in smaller pieces into it.
  3. If it does not work, you could email your catalog (just the *.lrcat file, it zips quite well), and I can try just vacuuming it with SQLite.
  4. If that doesn't work, then there's Dan Tull at Adobe, who is the catalog specialist and might be able to repair.

If option 1 or 2 work for you:
  • If you're satisfied with the catalog as it is (i.e. if you didn't use published services which will not be imported), you could replace your corrupt catalog by the new one
    (replace means rename the corrupt catalog, copy the new catalog to the same location and name it the same as the corrupt catalog was named before)
  • If you'd rather base your further work on the backup catalog, you could replace the corrupt catalog by a backup, open the backup and then import from catalog those parts (dates) which are not present in the backup yet.
    (replace means rename the corrupt catalog, copy the backup catalog to the same location and name it the same as the corrupt catalog was named before)

Beat

Hello

I'm runing windows 7 64 bit and lightroom 4.3, I accidently deleted my lightroom catalog but was able to recover it with a recovery sofware but guess what lightroom doesn't open it anymoore.All my work is there in that 150MB catalog.

I have uploaded my lightroom catalog that wont open can you please check it or repair it?All my work is there :( \

I uploaded my file here => http://dl.transfer.ro/transfer_ro-25apr-05aa9f867dae4.zip

thank you in advance
 

Victoria Bampton

Lightroom Queen
Staff member
Administrator
Moderator
Lightroom Guru
Joined
Sep 29, 2007
Messages
20,424
Location
Southampton, UK
Lightroom Experience
Power User
Lightroom Version
CC Cloud
#22
Hi leventeengel, welcome to the forum! Sorry it's a disaster that's brought you here.

I've tried opening your catalog into LR and into an SQL Editor, but it seems to be badly corrupted. I can't even get it to open in an SQLite Editor.

Do you have a backup we can help you restore? LR would have been asking you to back up regularly by default.
 
Joined
Apr 25, 2013
Messages
2
Lightroom Experience
Beginner
#23
unfortunately no :( that's why I was digging...I really didn't knew about what's a catalog, at least NOW I do :cry:
 

djeebah

New Member
Joined
Apr 29, 2013
Messages
2
Lightroom Experience
Intermediate
#25
Hello,

Having the same problem with the lrcat catalog.
I've tried: sqlite> echo .dump | sqlite3 dbase.lrcat > TempLRCatName.sql and nothing happens, only ...>
How could I email it to you to have a try?
Many thanks!
 
Top