HomeНаука и техникаRelated VideosMore From: Holger Mischke Photography

How To Fix A Corrupted Lightroom catalog file using SQLite

81 ratings | 10599 views
In this video i will show you how to fix a corrupted Lightroom catalog file. Here are the links i talk about in the video: The SQLite website: http://www.sqlite.org The Lightroom forums: https://www.lightroomforums.net A thread about corrupted catalog files on the Lightroom forums: https://www.lightroomforums.net/threads/repair-of-corrupted-catalogs.15926/ The Adobe Lightroom Community: https://forums.adobe.com/community/lightroom My profile on the Adobe Lightroom Community: https://forums.adobe.com/people/holgermischkephoto My Google+ profile: https://goo.gl/DSV7nv My homepage and portfolio: http://www.holgermischke.com/
Html code for embedding videos on your blog
Text Comments (213)
If you can't fix the file, please read through the comments as there is some valuable information in there. If you still can't fix the file, I usually offer that I can look at their file and see what they can do. This way I have helped quite a few people so far with a success rate of about 70%. If you want me to look at your file, mail me at holger(at)holgermischke.com. And for all those with the 0kb LRCAT file problem: Open the SQL file in a text editor. Find the line at the end which says ROLLBACK DUE TO ERRORS and replace it with COMMIT TRANSACTION. Save the file. Now try building the LRCAT file from the SQL file again.
Joel Hernandez (1 month ago)
Hi guys. In my case, I received the errors message. I looked at my NewLightroomCatalog and it had 0 kb. I downloaded UltraEdit https://www.ultraedit.com/downloads/ultraedit-download/ (free) to open up the TempLRcat.sql file because my file was close to 2.5GB and I couldn't open it in Wordpad or Notepad since it was too large. In UltraEdit, I replaced ROLLBACK DUE TO ERRORS to COMMIT TRANSACTION, saved it, then tried building the LRCAT file from the SQL file again. I received the long errors messages again but noticed the NewLightroomCatalog was 1.7Gb. I renamed that file to my original file, opened up this new catalog and it worked!
neno lima (1 month ago)
wowwwwwwwww.... with this way after to error following the video it worked wowwwwwww.. soooo happy.. thank you so so so so much... if I was woman I'd kissed you now with tongue hehehehehe... you helped me a lot, really! greeeeeeaeat.. I'm jumping and screaming now cause of this
Andrew Domingos (2 months ago)
Hi, there is a few lines of comands when i did the tutorial, whith a zero bytes file.
steve jarvis (6 days ago)
Can I say a massive thank you Holger using your video Ive managed to get Lightroom back up and running and can I echo what somebody else said bel;ow, this is the most useful video on You Tube. Would you mind if I ask you another question though, and Ive looked for videos on YT that might help and also googled this, but not found an answer. When I exit LR it asks me if I want to back up, Ive set it up to always do this, but if Im opening and closing LR several times a day I dont always do it, it also says its checking and verifying the back up, so you have confidence in Adobe and leave it at that. Last week however, I just thought Id try to install from the latest back up, and it didnt work, I tried the next oldest, that didnt work either, in the end I tried back ups from about 12 differrent dates and not one worked. Do you have any idea why this might be, or how to resolve it? For the moment, when I come out of LR Im going to just copy my LR cat somewhere else with the two associated files it uses. Thanks once again, I know your video was originally from 2 and a half years ago, but its so relevant today, so many thanks again Holger.
Hi Steve. Thanks for your kind words. I never had the problem you talked about but I'll look into it and see whether I can come up with an answer. If so I'll post it here
Richard Harrison (6 days ago)
In the second step I get a long list of errors like this: Error: near line 557347: no such table: sqlite_stat4. The process does complete - can these errors be ignored? Thank you.
Of course, there are errors, the file is corrupted and information was lost. Usually, you will end up losing some edits, depending on what happened and how badly your file was damaged. You will notice that the new catalog file is smaller than the original one. That is due to lost data and an optimization that is done in the process. Glad the video was helpful.
Sierre Siemens (15 days ago)
Hi Holger, thanks for the great video. My problem is, it says my lightroom catalog is 0kb. Nothing in it.
Hi Sierre, there is a solution to this in my pinned comment. If you still can't get it to work you can send me your file and I'll see what I can do.
Remco Hekker (27 days ago)
This is BY FAR the most useful Lightroom Tutorial I've ever seen. Ever since a year ago I've been having trouble with my Master (personal) catalog. I've had to restore backups regularly and somehow these got corrupted pretty much immediately. This method couldn't help me restore the main catalog, but it worked beautifully with one of my backups. Now I can finally get my metadata out of LR and into the new app that I'm using. I had given up on that. TANK YOU!!
Hi Remco, thank you very much for your kind words. Good to hear I could help you out :)
Mandi May (29 days ago)
Thank you, Holger Mischke Photography, for posting this video! I'm going through all of the steps on my mac and I'm stuck at the command prompt -I enter in everything as you demonstrate, spaces/no spaces etc., yet instead of a new file showing up in my SQLite folder I get this message in the command prompt window: -bash: syntax error near unexpected token `(' Mandis-MacBook-Pro:SQLite Mandi$ ...Do you have any idea why this is happening?
Mandi May (28 days ago)
You are a lifesaver!!! Thank you so much!! The reason I was getting an error code was because of my original lrcat name had a symbol in it -I removed it and it worked a charm!! Thank you, thank you, thank you!!!
zeyad ghareb (1 month ago)
what should i do after download all sQlite ??
Hi Zeyad. Just continue at 4:05 in the video.
Anmol Shelke (1 month ago)
i downloaded the file "adobe photoshop lightroom classic" and when tried to install it , it is showing "unexpected error opening catalog" plzz help me
Anmol Shelke (1 month ago)
Holger Mischke Photography thnks man its workin anyhow :)
That sounds weird. You tried to install Lightroom and during installation you get that message? Could you send me screenshots so I can understand what happened?
datavisuals (2 months ago)
I don't think I ever done anything so complicated on my Mac :D but it worked! I initially got the 0 bytes message, but fixed it with the COMMIT TRANSACTION line as Holger suggested in his comment. I also followed @Nathaniel Martin's advise for Mac users. Thank you so much Holger! Still not sure how the catalog got corrupted. It happened whilst copying it into another location (had to back up computer for a clean install). Have I not copied all the necessary files? :/ Anyway, I'm glad it worked. THANK YOU!
Glad I could help. All you really need is the LRCAT file. The previews will be rebuilt when you open the catalog again. So maybe something went wrong during copying or the drive you copied to was malfunctioning.
Andrew Domingos (2 months ago)
Funcionou para Mim também, porém também tive problema com arquivo zero bytes, e a dica de editar o arquivo sql gerado não funcionou.
Andrew, I do not know Portuguese at all (I think that's what you speak) but it sounds like you have the 0byte LRCAT file problem. Check my pinned comment at the top. The solution is right there.
WIEZZY Tactical (2 months ago)
Hey, really awesome of you to post a solution to this. My catalog file and all the backups got corrupted all at once. That said, I can't seem to get past the second step... I get the following error. Any ideas? -- Loading resources from TempRepair.sql Error: near line 721: UNIQUE constraint failed: Adobe_AdditionalMetadata.id_local Error: near line 723: UNIQUE constraint failed: Adobe_AdditionalMetadata.id_local Error: near line 729: UNIQUE constraint failed: Adobe_AdditionalMetadata.id_local [...this goes on for a few hundred lines...] Error: near line 15828: no such table: sqlite_stat4 Error: near line 15829: no such table: sqlite_stat4 Error: near line 15830: no such table: sqlite_stat4 SQLite version 3.24.0 2018-06-04 19:24:41 Enter ".help" for usage hints.
Thanks for your kind words. I learned a lot from YouTube tutorials and when my catalog file was busted I simply wanted to make the video I would have liked to find. I'm glad that so many people found it helpful.
WIEZZY Tactical (2 months ago)
Cool, well thank you VERY much for making this video. The most amazing thing about this however was not the video itself, but your willingness to respond to people's comments. I gave both your videos a thumbs up and I wish you success in your photography and YouTubing. Thanks again!
Partly those errors seem to come from the corrupted areas of your file and the rest of them simply don't matter at least when it comes to the functionality of your catalog file. That's what I think at least :)
WIEZZY Tactical (2 months ago)
Thank you for your response. I looked through the comments but somehow didn't see that pinned comment, so I apologize about that. I changed that line and it produces a catalog file that is 43 MB instead of 0 kb, and seems to have fixed the problem in my preliminary inspection, which means I can breathe again. However, I still get all the errors in the cmd prompt. Do those errors matter? Thanks again.
And it leaves you with a 0kb LRCAT file? If so, check my pinned comment at the top.
Sarah Frenchi (2 months ago)
I got a long list of error messages... does anyone know how to fix this ???
Check the comments. There is definitely something about this. Or mail me at holger(at)holgermischke.com
Sarah Frenchi (2 months ago)
for the new LR file yes its at 0kb
Which leaves you with a 0kb LRCAT file?
David Schultz (3 months ago)
Thanks for the video Holger. Not sure if you're still keeping track of comments and questions here. I made it through the first part after figuring out things are a bit different when Power Shell is being used. I can't seem to get the second/last step to work. I receive this message. J:\Lightroom repair attempt sqlite>sqlite3 -init tempcatalog81518.sql newcatalog81418.lrcat SQLite version 3.24.0 2018-06-04 19:24:41 Enter ".help" for usage hints. sqlite> All of the backups I have of my catalog seem to have been corrupted and Adobe said it might have to do with me saving those to DropBox. Getting rather desperate now. Thanks for any suggestions!
Hi David. Don't use PowerShell, but invoke the "old" command prompt by typing "cmd" in the search box. If you can't get this method to work, feel free to contact me: holger(at)holgermischke.com
Hi! I don't know if the problem is the last version of sqlite or my catalog. One year ago i repaired one catalog using this method but now, with another corrupt catalog i get this message when i do the last step. MacBook-Pro-de-Javier:SQLITE Javier$ sqlite3 -init temp.sql perfecto.lrcat -- Loading resources from temp.sql Error: near line 64118: no such table: sqlite_stat4 Error: near line 64119: no such table: sqlite_stat4 Error: near line 64120: no such table: sqlite_stat4 Error: near line 64121: no such table: sqlite_stat4 Error: near line 64122: no such table: sqlite_stat4 Error: near line 64123: no such table: sqlite_stat4 Error: near line 64124: no such table: sqlite_stat4 Error: near line 64125: no such table: sqlite_stat4 Error: near line 64126: no such table: sqlite_stat4 Error: near line 64127: no such table: sqlite_stat4 Error: near line 64128: no such table: sqlite_stat4 .............. .............. Error: near line 65262: no such table: sqlite_stat4 Error: near line 65263: no such table: sqlite_stat4 Error: near line 65264: no such table: sqlite_stat4 Error: near line 65265: no such table: sqlite_stat4 Error: near line 65266: no such table: sqlite_stat4 Error: near line 65267: no such table: sqlite_stat4 Error: near line 65268: no such table: sqlite_stat4 Error: near line 65269: no such table: sqlite_stat4 Error: near line 65270: no such table: sqlite_stat4 Error: near line 65271: no such table: sqlite_stat4 Error: near line 65272: no such table: sqlite_stat4 Error: near line 65273: no such table: sqlite_stat4 SQLite version 3.19.3 2017-06-27 16:48:08 Enter ".help" for usage hints. sqlite> Do you know any possible solution? Thanks!!!!
Laveta Beavers (2 months ago)
Thank you
Hi Javier. Yes you can send me your file. I'm in Bulgaria at the moment though so I can't look at it before next week.
Laveta Beavers (2 months ago)
Hello ... are you still offering help for this problem? I received the exact same error msgs when I tried this method
Javier Martínez de la Puente Sorry to hear it happened again. These error messages wouldn't necessarily mean that it doesn't work. You can send me your file along with some information about what what happened and what version of Lightroom you are using. Mail me at holger(at)holgermischke.com if you want me to take a look at your file.
Teresa Rish (4 months ago)
Didn't work for me. Any other suggestions?
Holger Mischke (4 months ago)
Hi Teresa, did you check the comment I pinned at the top? It has something Nathaniel Martin posted about properly opening a command window. And this will not create a temp folder, but a temporary sql file, from which the lrcat file will be recreated and it will be in the same folder you put the SQLite files and the corrupted lrcat file in. I can offer you what I offered anyone here - I can look at your file. Mail me at holger(at)holgermischke.com.
Andrew Zubov (5 months ago)
Thank you very much!! Restored catalog Lightroom CC for macOS Sierra. You helped me a lot!:)
Kha Do (5 months ago)
Hi, I just discovered this video while looking for solutions for my corrupted catalog. This method seemed to help a lot of people and I'm hopeful it still can. I've tried the steps in this video and still no luck. Any chance I can send you the file and you take a look at it?
Kha Do (5 months ago)
I get this every time i walk through the steps of the video : Error: near line 1757419: UNIQUE contraint failed: AgLibraryImageSyncedAssetData.image, AglibraryImageSyncedAssetData.payloadKey
Kha Do (5 months ago)
Emailing you. Thank you so much. Any help is greatly appreciated.
Kha Do You certainly can. Send your file along with a description of what happened and what version of Lightroom you are using to holger(at)holgermischke.com. And please be patient. I am shooting in southern France right now and I can't look at the file before I'm back on June 25th. I'll let you know as soon as i looked at your file.
Omar Y Abby (5 months ago)
Thanks. May I ask what else you could try when this doesn't work? I'm one of those who got errors and a 0kb file- had tried to repair. what else do you do and have you had success? thanks.
Hi Omar. This is often the result of SQLite thinking there are too many errors in your file, so it rolls back the operation. I think someone posted about that in the comments, just search them. You'll have to prevent it from rolling back the process and make it commit the changes. This is done by opening the file in an editor and changing the line rolling back the process. If you need help with this, you can send me your file at holger(at)holgermischke.com.
Bruselas E. Malca Guerra (6 months ago)
I got 0 data, someone who currently knows how to repair, it hurts me to lose my information
Sarah Morgan (7 months ago)
Thank you so much for posting this video! It was the only source I could find that didn't just say to use a backup.
Sarah Morgan You are very welcome. I'm glad I could help.
Felix K. (8 months ago)
you coud have gotten to the point a lot quicker.. I was watching in 2x speed and it was still slow...
steve jarvis (6 days ago)
+Felix K. Hi Felix, if you dont mind me saying so I think youre being a little unfair on Holger, many people are not that computer literate, obviously you are as you ran the vid through at 2 times speed and wanted the point to be made even quicker, but looking at all the comments above there are probably a lot of people out there like me, think theyre reasonably computer literate, but then find theyre being taken in a direction theyre not comfortable with. In my case, Id never been near SQL before, so this initially frightened the life out of me, but I watched it all the way through then the first part again, doing each part as directed and it worked, so if this happens with my LR again Id be a bit more confident sorting it out, thanks to the patience Holger showed in putting the fix across in reasonably simple lay mans terms.
Felix K. (8 months ago)
alright then. In my opinion it was very slow, but I guess that's only me then
It is a step by step tutorial that was intentionally very detailed so everyone can follow it. And even like this I got mails and comments from people who made mistakes or didn't understand. If I had "gotten to the point quicker", even more people would have been confused.
KCMWSOT (11 months ago)
I'm posting this where ever I can as these solutions did NOT work for me but the method I used DID. Step 1: DO NOT LET LIGHTROOM TRY AND REPAIR NOR "Check Integrity" of your catalog. I immediately ruined (I think) my chances of using the SQL method. If you already tried this do not despair. Step 2: delete (in the Lightroom folder) everything except the .Ircat file of your catalog itself. (or make a backup if it allows you, at this point mine didn't and gave me an error code in trying to copy any of the files anywhere else than my hard drive) Step 3: Launch (LR) lightroom with a brand new catalog. Close it. Step 4: Launch LR with old corrupted catalog. It should let you check it now and open as normal. (if it doesn't keep reading) HERES WHERE IT MATTERS! you have a time frame/ window of anywhere from 5 to 15 seconds before Lightroom loads your entire catalog (the more images your have the better) and gives you the error again that its corrupted. NOW IS THE TIME TO GO UP INTO THE MENU BAR AND SELECT ALL! I Repeat SELECT ALL! Move fast and then hit command + S. At this point it loads the error message BUT if you notice on the top left bar, it starts going through the action of saving all your side cars/ xmp files. It wont save all your work done, (I lost about maybe 8 edits) BUT it'll save you a grand majority of the work. DO NOT PRESS OK on the prompt that tells you lightroom needs to close untill its done saving the side cars. Along the way I got other prompts that stated some could not save and it gave me the option to save as text, of which I haven't tried implementing back. LAST STEP: If it didn't let you launch as normal in step 4, or you have presets like custom color filters you made (I lost watermarks I had manually saved so I didn't care to hassle with it) to back up, youre going to a) make sure again you delete in that folder all of the files as they regenerate each time you launch, except the actual catalog file, and b) you're going to want to move it to a new folder / area within the hardrive. and start from step 1. A hassle, but for me was worth saving 2+ years of edits. I dont know nor didn't care to try seeing if this saves any smart filters, or other metadata/ organizing as I never really used LR as comprehensively as I could've, but in theory should work. You may find you'll have to restart your computer at times and strongly suggest you backup (if you dont already) your virgin files into a backup drive before starting (minus the corrupted catalog folder, it gave me glitches when I tried)
Omar Y Abby (5 months ago)
i'm willing to try this, but you said to delete everything in the Lightroom folder..can you clarify? I have the lcart and lrdadta folder in same directory.
KCMWSOT (11 months ago)
let me know if this works for you everyone :)
Sal Fra (1 year ago)
Hi Holger. I tried your method to repair my lightroom catalog but it does not work with my file. the difference I see with respect to the video is that the temporary file I create remains at 0 bytes, while in the video 12.25, the file becomes about 540 MB. I seem to have followed the steps correctly but it does not work. what can be the error? thank you. Salvatore
+Sal Fra It's not that scary :) If you want you can send me your file. Depending on the size you can use wetransfer or send me a download link for Dropbox. My mail is holgermischkephoto (at) gmail.com.
Sal Fra (1 year ago)
Hi Holger . I also tried this solution but unfortunately it does not work. It is a catalog with about 15,000 photos and if I should start from the beginning I'm scared :). can you help me?
Hi Salvatore. Scroll down and you'll find a comment by neha anil with a link in it. Maybe that will help you. If not, as always I can offer you to look at your file and see what I can do.
Ralph Raphael (1 year ago)
YOU ARE THE MAN!!! THANK YOU SO MUCH
+Ralph Raphael I guess I am then ;) Thanks Ralph!
Thank You Thank You and Thank You...Really Appreciate your assistance.
+Riaz Hathey Photography And I really appreciate your comment. Thank you.
patrishmas (1 year ago)
I have sick children and it's my 3rds first birthday and I'm hoping I can figure this out to recover 1000 images I had just finished editing before the catalog went corrupt. Thanks in advance for the video
Fredrik Håkansson (1 year ago)
Great tutorial, but I fail at the step where I should copy the lrcat.file from my original source (in my case an external harddrive) to the sqlite folder in the C:-drive. When simply trying to copy+paste the catalog-file, it loads about 60% before giving me the error message "Can't read from source". I did manage to compress the catalog into a zip-file, copy the zip-file to the C:-drive and unzip it there, but then the catalog was reduced from 246 mB to 145 mB. Trying to compress it into an RAR-file won't work, as I got the same error message I got earlier after loading 60% ("can't read from source"). When I proceeded with the smaller file, doing the steps in the command window, I managed to create an sql-file. But trying to turn the sql-file into an lrcat-file turned into an empty lrcat-file (0 byte) that can't be opened. I've also tried importing the corrupted catalog into a new, fresh catalog, without success. I did try to repair the catalog as that option came up (which I now saw you recommending to avoid), a couple of times even. The external harddrive works fine in every other way, I can also access and open the backup-files that are also stored on the external harddrive. The backup files are old as fuck though, so I would hate going back redoing many hours of editing. Any suggestion what else I could try to do with my corrupted catalog?
Fredrik Håkansson (1 year ago)
Holger Mischke Photography Unfortunately I don't have another device to try it on, but it might very well be the computer that is the problem (had troubles with another external drive that disconnected frequently).
+Fredrik Håkansson That sounds weird. I never had that problem. Googling "evenfall hard drive can't read from source" brought up some articles that mentioned hardware problems like bad sectors and such. Also have you tried connecting the drive to another machine and copying it there? Just to see whether the hard drive really is the problem? Good luck.
Fredrik Håkansson (1 year ago)
Update: After reading through some comments I discovered that user neha anil experienced the same problem with an empty (0 byte) lrcat-file, but were kind enough to post an solution, which can be found here: http://bitmason.blogspot.se/2013/01/recovering-corrupt-lightroom-catalogs.html In short: Open the sql-file file (for an example in Notepad++) and replace the last line that says: "ROLLBACK; — due to errors" with the line: "COMMIT TRANSACTION;". Then proceed in the command window, and it should work. In my case this kind of solved my issue. I was able to recover the most important part of my catalog (thank god!), but have to redo a couple of edits on older work. Still, better than nothing! Thanks a bunch for the video. :)
Sugarjellyland (1 year ago)
Thank you so much!!! It's WORK!!!!!!
Jackie Walker (1 year ago)
Hi Holger great video and really clear to follow. I followed it step by step and I am sure I did everything exactly as you said but unfortunately like a few others the new lrcat file is 0 bytes and then not recognised as a valid catalog file when I try to open it. Any ideas? Any help gratefully received. Thanks Jackie
+Jackie Walker Hi Jackie. There is now info in the article Neha Anil linked to below. If you still have problems you can send me the file and I'll see what I can do.
Jackie Walker (1 year ago)
Just tried the change of text file command to commit the transactions and it all appears to now be working. It has now backed up and optimised fine so fingers crossed it now stays this  way. Thanks again for a great video.
neha anil (1 year ago)
Thanks for your help. It kind of worked for me. I had to make a change in the sql file as i was receiving a 0 bytes lrcat file after the whole process. Whoever wants some extra info can visit http://bitmason.blogspot.gr/2013/01/recovering-corrupt-lightroom-catalogs.html. My question though is that my original (corrupted) lrcat file was 77Mb but the converted sql to lrcat file was 41Mb. Is this due to some weird compression or does this mean that I have lost some of the information, i.e. lightroom post-processing? Any ideas from anyone would help. I'm currently going through the photos of the catalog, but it seems that the thumbnails are loading suuuper slow...so I don't know yet what has been salvaged... Anyway, good luck with your case! :)
Roman Ht (8 months ago)
Yes, in this link Ifound critical changes into sql file.
neha anil (1 year ago)
It appears that there is an issue, when I try to export 1, many or all images in a folder. Error said "Unable to export: An internal error has occurred: ?:0: attempt to index a nil value." I'm currently searching for a solution, with no luck so far. If you have any ideas of how to fix this, I would really appreciate it. Thanks!
+neha anil It doesn't necessarily mean you have lost something. During the process of rebuilding the file gets optimized, at least that's my guess. All the files I fixed were smaller after the process.
April Daley (1 year ago)
I tried to do this on a mac, and I was able to get it all done the way it was said but I keep coming up with a zero byte file. Can you explain why this happens? Looking back at previous comments it looks like you can fix that but Im wondering what Im doing wrong. Any ideas as to why, if Im following your instructions perfectly, it wouldn't work. Im using the newest lightroom i think.
Ryan DeCorby (5 months ago)
I am having the same issue, several lines that state "Error: near line 2555500xxx: no such table: sqlite_stat4 Unfortunately for me I have a very large library and rather frustrated that it and all the backups are corrupt and were not caught during Lightrooms normal check and backup.
+April Daley Often this was a result of SQLite rolling back the whole operation because it considered the amount of errors and / or their severity as too much. I say "often" because I can't be sure that is the reason in your case. If you like you can send the file to holgermischkephoto (at) gmail.com and I'll check it.
Nicholas Milano (1 year ago)
I tried the procedure multiple times, but no luck...After following all the steps, new catalog file has no data, in facts it reads the size as 0kb. My master catalog is around 5.6gb, extracted .sql file is 5.3 GB. Seems like I will never be able to restore it, and unfortunately i have no recent backup of it... Catalog got corrupted while editing pix in LR when suddenly blue screen stopped my work :( :( :(
Rafa A.Pontes (1 year ago)
Exactly the same issue : I try with two different files, both corrupted. The "current" one has a size of 7.5gb, and a backup one wich is smaller (around 5.5gb). In any case, I can generate a valid .sql but after that the final .lrcat is empty, with a size of 0kb.
If you're sure you have done everything correctly you can send me your corrupted file and I'll see what I can do. Ma mail is holgermischkephoto(at)gmail.com and since your file is so large, please zip it and use wetransfer.
gregory ross (1 year ago)
Hi Holger! Thanks for making such a great tutorial. I think I followed everything you said but I am still having an issue. I am getting an error saying the new catalogue is not recognized as a valid catalogue. Have you encountered this before? I am using LR 5 on a MAC.
+gregory ross Just send me a copy of the corrupted .lrcat file. Along with a short description of what happened and which version of Lightroom you have. Send the file via wetransfer to holgermischkephoto (at) gmail.com. Thanks :)
gregory ross (1 year ago)
Thanks for the quick response! I would really appreciate that, which files exactly would you need me to send? Thanks again!!!
+gregory ross Hi Gregory. I can't say I have seen anything like that yet. If you're sure you have done everything correctly you can send me your corrupted file and I'll see what I can do.
Malcolm Obi-Allison (1 year ago)
Hi thanks for this information. unfortunately, I don't know how to apply it in Mac. please if you know let me know. I have a pressing jobs to do
+Malcolm Obi-Allison If you can't find all the info you need in the comments and in my pinned post above, you can mail me and I'll send you instructions for Mac.
Angelika Johns (1 year ago)
THANK YOU SO MUCH! You saved me so much time and an almost missed deadline. Amazing.
+Angelika Johns You're most welcome 🙂
Elli Ziebritzki (1 year ago)
Hallo Holger , Ich habe deine super Anleitung gefunden um einen defekten Lightroom Katalog zu retten... ich habe alle Schritte genaustens befolgt, leider hat meine "newLightroom5Catalog" Datei immer 0 Byte. 😞
Elli Ziebritzki Die Adresse ist holgermischkephoto(at)gmail.com.
Elli Ziebritzki (1 year ago)
Guten Morgen Holger, das wäre ja heldenhaft! Ich bin ab 17:30 wieder am Schreibtisch und kann dann die Datei senden, per Wetransfer? und an welche Adresse? Meinen Problembericht füge ich dann bei:) Ich danke Dir!
+Elli Ziebritzki Hallo Elli. Wenn du dir sicher bist, dass du alles wie beschrieben gemacht hat, kannst du mir gerne deine Datei schicken und ich werde sehen was ich tun kann. Am besten noch mit ein paar Sätzen dazu wie es dazu gekommen ist und was du bisher mit der Datei gemacht hast. Die Kopie die du mir schickst sollte keine Reparaturversuche hinter sich haben. Weder von Lightroom noch von dir. Einen schönen Abend 🙂
Elli Ziebritzki (1 year ago)
Achso, ich nutze Lightroom 5, in der Version 5.7
neny316 (1 year ago)
Holger Mischke, I wish I could get some assistance. I followed your video to the T, and after the first command. I get nothing, just a error right away in the created .sql file. "PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; /**** ERROR: (26) file is encrypted or is not a database *****/ ROLLBACK; -- due to errors" I recently recovered my catalog files and backup from a failed hard drive and i can't get anyone of them to load up in LR. From not readable/writable, to unexpected error. This SQL process seems to be my only hope. Please Advise. Windows 7, LR 5.3. Many thanks in Advanced,.
neny316 (1 year ago)
Thanks for the quick response. I was just about to delete this comment. I was able to do so with your method today, just as described from the original file on the laptop where recovery was placed. So this time there was no transferring or even disk check from the new pc and hard drive. I said let me give it a shot it it worked like a charm. Just as you said it would in the video. Maybe this can help other moving forward. Thanks again for your video and detailed explanation on the process. It saved me 7 yrs of catalogs and etc. as it seemed that all the backups were having similar issue. Will learn from this mistake to keep them separately now. God Bless.
Hi, thanks for watching the video. I had errors like that with files people sent to me which were recovered from damaged hardware. I don't know what exactly the recovery software does to the files, but it's not something this method can fix. You can still send me your file and I'll see what I can do.
Andres Amador (1 year ago)
Thank you for this thorough walk through. I am getting stuck at the second command. When I enter it I get the response: Error: unknown option: -init? Sooo wanting this to work, as you can imagine! Feeling so close!
Andres Amador (1 year ago)
wow, thank you for checking in! I wish I had seen your response earlier. I went back to a month old save and have been working my way though it getting things back in place... a huge hassle! so that's where I am and there's no going back. thanks again for checking in. blessings!
Did it finally work for you or do you want me to check your file, Andres?
+Andres Amador If you're sure you've followed every step correctly and without any typos, you can send me your file and I'll see what I can do.
Ásgeir Ásgeirsson (1 year ago)
Thanks for you video Holger - I tried but the catalog is has way too many errors for my brain to figure out. Any advice?
Ásgeir Ásgeirsson (1 year ago)
Hi Holger. No, didn't need to use the recovery software, but due to the unexpected outage of power it got somehow corrupt. It's from LR 5.7, and no worries mate - if you have a moment anytime - i'm just greatful for that already.
+Ásgeir Ásgeirsson I need to know which version of Lightroom you're on and what happened resulting in the data corruption. Did you have to recover the file using recovery software? I'm not sure but I might be able to look at it this weekend.
Ásgeir Ásgeirsson (1 year ago)
Seriously - wow - you are a saint Holger :D I'll send you it via wetransfer or dropbox - it's big i'm afraid but after the horrors of failed raid0 backup of the backups (due to a power outage and then huge computer problem - I had lost hope and well, started to think I would have to import every photo from my backup and write in all the data again.
+Ásgeir Ásgeirsson Hi and you're welcome :) If you're sure you've done all the steps correctly, you can't still send me a copy of your corrupted file and I'll see what I can do.
www.islandrover.net (1 year ago)
i encountered an error message when I run the second command "Error: near line 256289 tree is too large (maximum depth 1000)" any solution?
www.islandrover.net (1 year ago)
Hi, something strange happened when I open Lightroom today. I was able to access the latest catalog. I think the cause was the connection of my external drive where I stored my pictures and lightroom catalog. All is well now after I restarted my laptop and reconnected my external drive
Holger Mischke (1 year ago)
www.islandrover.net, even zipped you can't send it via wetransfer? Or upload it to Dropbox and send me the link?
www.islandrover.net (1 year ago)
Hi Holger, the file is more than 1 G. I have difficulty in sending. thanks anyway. I'll keep on checking your youtube to see any updates
Hi. I have heard about that message. but even when they sent me the file, I've never seen it myself. It is a limitation that SQLite sets to save space. You can disable these limits at runtime, it's ll in the documentation on the SQLite site. Or if you wan you can send me your file I can look at it and see what I can do.
chris oldale (1 year ago)
Fantastic tutorial, thanks! Unfortunately I get "Error: near line 8638: Expression tree is too large" repeated for 80 ish lines. I googled the problem & got the following result but have no idea what to do with it; http://stackoverflow.com/questions/43145117/sqlite-error-expression-tree-is-too-large-maximum-depth-1000 Any ideas?
chris oldale (1 year ago)
will do, what email shall I send it to please?
Zip the file up and send it by wetransfer please. :)
chris oldale (1 year ago)
Still the same, can I send you the lrcat please? is the best way via your website?
chris oldale (1 year ago)
Thanks for the quick reply! I will give it another couple of attempts & let you know ;-)
Hi Chris. As i told Jakub Kulpa, i have heard about that message from someone, but when i looked at the file it didn't happen and i could fix it. If you are positive you have followed all the steps in the tutorial correctly, you can send me your file if you like and i'll see what i can do.
Jakub Kulpa (1 year ago)
sqlite give me info about errors due to long tree extansion (max depth 1000) and when i try to open this new catalog it is still not working, any other advice ?
Jennifer Renfro (1 year ago)
I had this same issue -- a long list of errors after creating the TempLRCat.sql file.
+Jakub Kulpa I have seen this message before in a catalog file I was able to fix for someone. If this procedure doesn't work for you, you can send new your file and I'll see what I can do.
Kellie Hunter (1 year ago)
THANK YOU! You saved me so much time!
Kellie Hunter I'm glad I could help
SARAH THE STAR (1 year ago)
Hi Holger, it didn't work for me. I got a new lightroom  catalog but it's 0 KB and won't open in lightroom. Can you help? Thanks for the great tutorial.
+Bardiel7777 Could you please send the mail describing what happened and what version of Lightroom you are using?
+Bardiel7777 I will look at it tomorrow. Please mail me at holgermischkephoto(at)gmail.com and tell me what Lightroom version you use and what exactly happened when your catalog got corrupted.
Bardiel7777 (1 year ago)
I would be greatfull, https://www.dropbox.com/s/l0bss789szwm017/LightroomCatalog.lrcat?dl=0
+Bardiel7777 Sorry to hear it doesn't work for you. If you are sure you have followed all steps correctly, you can send me your file and I'll see what I can do.
Bardiel7777 (1 year ago)
Got same problem. O KB :( Please help
Trevor Morrison (1 year ago)
Hi Holger! I was hoping to get some advice on this... I am working off of a mac and got as far as typing in the first command, however it does not create a new file or seem to be doing anything after typing the command and pressing enter. Any ideas on why this may be? Thanks so much for taking the time to help us all! True digital hero!
Hi Trevor. Thanks for the kind words. There is no guarantee this process will work for every corrupted catalog. I can offer you what i offer anyone having trouble with this - send me a copy of your corrupted file and tell me which LR version you are using and i'll see what i can do.
Trevor Morrison (1 year ago)
Follow up - It seems I got through all the steps thanks to Nathaniel Martin's advice... however the new catalog says it is zero bytes and when trying to open it, I get an error message saying that it is not a valid catalog, any thoughts?
synesthaesia (1 year ago)
Thank you so much for this clear guide. You have just saved my 140000+ image catalog. Somehow my catalog and all backup became corrupted at the same time and I was at a complete loss until I found this.
synesthaesia This just totally made my day. Glad I could help :)
Bert Kempeneers (1 year ago)
Thanks a lot for the great tutorial! Work of a lot of hours safed! Regards from Switzerland!
+Bert Kempeneers you're very welcome. Good to hear it worked for you.
Alina Stetsurina (1 year ago)
Hi! It didn't work for me. I got NewCat.lrcat file with zero bites. Could you look at my corrupted file?
Kisheen Buchanan (7 months ago)
Hi I also have the same problem. Should it stay at 0 KB?
Alina Stetsurina Did it work for you after all? I didn't receive a file yet.
Alina Stetsurina Absolutely! Just send me a copy of your file.
Vikram Verma (1 year ago)
Hi Holger, I tried your solution, but unfortunately it didn't work for me. I must mention that I did click on repair option of lightroom multiple times before I came across your video. I followed the exact steps after that, but somehow it didn't work for me. I even asked Adobe guys and they came back to me stating my catalog is beyond repair. I don't have backup of my catalog unfortunately. So, I am so scared that I have lost all the data.
Hi Vikram Verma, sorry to hear that. If you want you can send me a copy of your corrupted catalog file and I see what I can do.
Douvision Official (1 year ago)
thanks so much, your video was very helpful
You are very welcome :)
Kammy (1 year ago)
Thank you so much!! It worked on my catalog!
Holger Mischke (1 year ago)
Kammy Good to hear it worked for you. 🙂
aznbb0i (1 year ago)
OMG Thank you sooo much for this tutorial. I really thought I had lost all my previous work.....this really was the last resort. Again, thank you so much!!!!!!! Much appreciated!!! And yes, this works in Lightroom CC
Holger Mischke (1 year ago)
aznbb0i It just makes me happy to help or so many people with so little effort by just making a short video. You are very welcome 🙂
Sandra Doerpinghaus (1 year ago)
Hi Holger, I was so happy to find this video but unfortunately the command doesn't quite work with my files. I am on Mac. So I did what Nathaniel said with the terminal command. But then after I type in the command and hit enter I get this: Sandra1-3:SQLITE sandra$ echo .dump | sqlite3 Lightroom Catalog .lrcat > temporarycatalog.sql Error: near "Catalog": syntax error Anyone having any idea what I am doing wrong???
Sandra Doerpinghaus (1 year ago)
Hmmm mine is 1.3 Gig. Maybe not. I am always half way through recreating the lost files. So it will all be good. Just one days work lost.
Holger Mischke (1 year ago)
There is another method using an application (http://sqlitebrowser.org/). There you use File>Export>Database to SQL file and then File>Import>Database from SQL file options. This is what i did with Carlos' file which he couldn't fix using the method in the video. Note though that this method takes A LOT LONGER! Carlos' file was just 16MB and it took about two hours if i remember correctly. If you can't figure out how to work with the database browser, i'll have a video up about this shortly or just mail me and i'll explain with screenshots. :)
Sandra Doerpinghaus (1 year ago)
I got it about 5 minutes after I wrote that message. Stupid me, thought I could multitask and didn't pay attention about the spaces. Anyways, even though it worked after that, I wasn't able to repair it. It must have gotten corrupt when my HD broke apart. I fixed my problem by going back to a time machine back up file. unfortunately I couldn't recover THAT file.... Thanks anyways to put the video up - gave me some hope for a while.
Holger Mischke (1 year ago)
Sandra Doerpinghaus Try it without the spaces in "Lightroom catalog .lrcat" so it reads Lightroomcatalog.lrcat and make sure the file is renamed that way before you use the command. And of course rename it back to what it was before using it with Lightroom again. Hope that helps.
Kyle Coburn (1 year ago)
Thank you for your time! Works on Lightroom CC 2015.7 LRCAT!
+Kyle Coburn You're very welcome! Good to hear it worked :)
Carlos Bartol (1 year ago)
Hi! It doesn't work for me. Could you help me ? I have the first half right, with my .sql file. But when I do the second line I get this: -- Loading resources from TempLRCat.sql SQLite version 3.15.1 2016-11-04 12:08:49 Enter ".help" for usage hints. sqlite> and instead of the two new files you have (.lrcat & journal) I only have a .lrcat of 0KB Hope you can help me! Thank you very much!
Anders Stokke (1 year ago)
I'd love to hear what second approach you have as I am currently in the exact same situation where sqlite seems to work with the temp-file for about a minute but then ends up with a 0kb lrcat-file and starts sqlite (prints version number and "enter .help ..."). Catalog file is around 1.5Gb (LR6)
Carlos Bartol Glad I could help. I tried something else on your file. I'll post a video soon on this second approach. Thanks for your kind words :)
Carlos Bartol (1 year ago)
Hi! It works great! Thank you very much. It seems that everything is perfect. I had to changed the location of some files and copy the settings of the .dng into the originals .nef i had, and it works great. ¡¡You are awesome!!
Carlos Bartol (1 year ago)
Holger Mischke Photography Thanks! I'll check tomorrow and tell you!
Hi Carlos. I am now uploading the fixed file to wetransfer. It looks okay to me, though you might have lost some images in the folder of 29, but from looking at it it seems you have most if not all in the folder with the 900+ images. Check it and let me know :)
JGIA1 (2 years ago)
THANK YOU!
Holger Mischke (2 years ago)
You're very welcome :)
Paulo Henrique Cruz (2 years ago)
That was just GREAT !!!! Thanks a lot for your help. I had more than 3k photos already post-produced... a week of work. You did great !!! Thanks a lot my friend !! Best regards. Paulo Cruz (from Brazil).
+Paulo Henrique Cruz Thanks for your kind words, Paulo :) Always happy to help.
Holger Mischke (2 years ago)
Thanks for your comment, Jimmy. I'm glad my video actually helped some people :) By the way I found this solution on the net and just thought this could use a video, because it sounds somewhat complicated when you read it. :)
Jimmy Dozer (2 years ago)
SO GRATEFUL! I am using LR with my catalog file on a removable eSATA drive and using it on two different Windows 10 computers. When Win10 doesn't fully shutdown (Google a way to fix this) it has corrupted my lrcat file several times. YOUR SQLite process above has SAVED MY BACON several times now- thank you for posting this!
Holger Mischke (2 years ago)
Thanks for the comment, Nathaniel. I wouldn't have known about these Mac commands. Good thing you managed to recover your catalog file :)
Nathaniel Martin (2 years ago)
Thanks so much for the video! You saved my life haha. Just a helpful hint for anyone using a MAC. In order to properly open a command window you will need to go into system preferences/Keyboard/Shortcuts/Services and click on "New Terminal at Folder". Now right click on the folder containing the sqlite files and your catalogue and select services/new terminal at folder. At that point you can continue with the commands shown in the video.
datavisuals (2 months ago)
You helped me my friend! Thank you :D
Hi Nathaniel. Could you please post the exact commands you used on the Mac as they are a bit different from the commands used on Windows? That would be very helpful.
Jimmy Uptain (1 year ago)
Dude, I was struggling until I read your comment, thanks so much.
Holger Mischke (2 years ago)
Hi Drew, I'd be happy to help you if you are still facing problems after watching the video. Please go to my website holgermischke.com and send me a mail using the contact form. I'll get back to you as soon as I can and we'll see what we can do to recover your catalog.
Holger Mischke (2 years ago)
+Drew Kittredge That's exactly why I made this video. I'm very happy that it helped you fixing the file. And thanks for subscribing. :)
Drew Kittredge (2 years ago)
Thanks Holger. I found I had to just take another step backwards and run a windows disk errors check to first fix any hard drive errors, then run the SQlite process again and it worked. Thank you so much for making this video. You really saved me. This is definitely something that needed to be explained by video, at least for me, so I can't thank you enough for your efforts.
Drew Kittredge (2 years ago)
Thanks for this. There are a few others who have tried to explain, but it's so easy for someone who never deals with these things to miss some minute detail. While I got much further than following any one else's directions, all I came up with was an empty, 0kb cat file. This may be tied to the fact that I couldn't even copy the corrupted catalog file to the same sqlite folder.

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.