• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Corrupted catalog

Community Beginner ,
Jul 26, 2018 Jul 26, 2018

Copy link to clipboard

Copied

Hi, guys!

I have a problem with a LR catalog.

I am openening it, can see my last imported photos and then i have an error: LR encounted an error when reading a catalog file and need to quit. Then LR is shutting down and then trying to repair the catalog with no result.

Unfortunatly I have no backups. So how can i repair my catalog? It contains photoshoots for 2 years.

Thank you!

Views

12.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 26, 2018 Jul 26, 2018

I can't say whether this will work for you of if you are willing to give it a try... comments indicate that others have been successful repairing a corrupt catalog using this method.

How To Fix A Corrupted Lightroom catalog file using SQLite - YouTube

Votes

Translate

Translate
LEGEND ,
Jul 26, 2018 Jul 26, 2018

Copy link to clipboard

Copied

The only advice I have seen is to open a new catalog and then try importing the corrupted catalog into it. I am quite skeptical that this ever works, but who knows. After that, I think you're out of luck.

Make regular and automated backups of your catalog file and photos from this point forward. No excuses.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 26, 2018 Jul 26, 2018

Copy link to clipboard

Copied

Thank you for the piece of advice, but how can i open an older catalog in a newer one?

Thank you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 26, 2018 Jul 26, 2018

Copy link to clipboard

Copied

polinab  wrote

Thank you for the piece of advice, but how can i open an older catalog in a newer one?

Use the menu command File->Import from Another Catalog

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 26, 2018 Jul 26, 2018

Copy link to clipboard

Copied

unfortunatly, no

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 26, 2018 Jul 26, 2018

Copy link to clipboard

Copied

any other ideas?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 26, 2018 Jul 26, 2018

Copy link to clipboard

Copied

Here is the error:

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 26, 2018 Jul 26, 2018

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 26, 2018 Jul 26, 2018

Copy link to clipboard

Copied

As far a I know, this is the end of the trail. The catalog cannot be fixed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 26, 2018 Jul 26, 2018

Copy link to clipboard

Copied

I can't say whether this will work for you of if you are willing to give it a try... comments indicate that others have been successful repairing a corrupt catalog using this method.

How To Fix A Corrupted Lightroom catalog file using SQLite - YouTube

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 28, 2018 Jul 28, 2018

Copy link to clipboard

Copied

Thanks! I will try!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 22, 2021 Aug 22, 2021

Copy link to clipboard

Copied

Import 'from another Catalog' (into a fresh one) did do the trick for me - once, the only time, when my catalog was not directly openable - although LR has also asked for a couple of catalog integrity fixes over the years.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 26, 2018 Jul 26, 2018

Copy link to clipboard

Copied

Do you have backups for your catalog?  If you don't know, search all your drives using the term "backup"

The backup folders that Lightroom creates look like this:

LR backup folders.PNG

If you find those, pick the most recent one and open the folder. The file inside will be a .lrcat.zip file you will have to unzip. The unzipped file will end with .lrcat. Open that unzipped file in LR.

Ken Seals - Nikon Z 9, Z 8, 14mm-800mm. Computer Win 11 Pro, I7-8700K, 64GB, RTX3070TI. Travel machine: 2021 MacBook Pro M1 MAX 64GB. All Adobe apps.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 28, 2018 Jul 28, 2018

Copy link to clipboard

Copied

Unfortunatly, I haven't

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 28, 2018 Jul 28, 2018

Copy link to clipboard

Copied

I'have found the solution: Corrupt Catalog Issues

- Download SQLite, put it in a folder, make a COPY of your lrcat file and put it in the folder.

- run sqlite3 "INSERT_CATALOG_NAME_HERE.lrcat" .dump > Temp.sql

- run sqlite3 -init Temp.sql NEW_CATALOG_NAME.lrcat

- This is where the existing online tutorials break down, if there are errors, it will not dump out the new database file!  You can't just tell sqlite to dump a corrupt catalog to corrupt sql and back to a corrupt catalog...you're not fixing anything.

- Note the errors that the last command generates.  It will give you line numbers for the errors.  For me, I was getting "UNIQUE constraint failed" errors and "no such table" errors for the table sqlite_stat4 on a couple hundred lines or so.

- Open the Temp.sql file in an editor.  Notepad will work but it's way easier to deal with line numbers in something like Notepad++.

- Remove the exact lines which are generating errors and only those lines.  As you are working in the file, you may need to be patient with your editor if the file is large.  Jumping around, deleting lines, saving, may all take some time to complete...just wait for notepad++ to do its thing and unfreeze as you're working.

- If you try to use the file at this point, it won't work!  it will generate a 0 byte catalog (At first I had this problem).  The reason for this is that SQLite writes "ROLLBACK;" as the last line in the file due to the errors it encountered during the dump process.  See here: sqlite - Sqlite3 recreates empty database from dump file - Stack Overflow .  What you need to do is change that last line to say "COMMIT;" to commit the changes instead of rolling back.

- Now save the file...let's use TempBadLinesRemoved.sql and exit notepad++ or your preferred editor.

- run sqlite3 -init TempBadLinesRemoved.sql NEW_CATALOG_NAME.lrcat

- for me, the command completed and left me at the sqlite> prompt.  Just type .quit to exit sqlite

- Open the catalog in lightroom and it should work.

I am so happy! thank you very much! 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 21, 2019 Dec 21, 2019

Copy link to clipboard

Copied

I'm trying to follow your steps but I noticed that the UNIQUE constant failed errors lines in my case are in the range of milions (i.e. Error: near line 1121903: UNIQUE constraint failed: Adobe_imageDevelopSettings.id_local) instead when I open the .sql file are in the range of thousands.
Any suggestions?

Thanks in advance!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 15, 2020 Feb 15, 2020

Copy link to clipboard

Copied

Despite the errors you should be able to open the newly created catalog and it should run without problems. Can you confirm?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 13, 2020 Nov 13, 2020

Copy link to clipboard

Copied

Oh my God! Dude. This was a lifesaver for me. Recovered my catalog successfully after getting rid of few UNIQUE CONSTRAINT errors and putting COMMIT at the end. 

 

Using Lightroom Classic 10.0 (2020)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 22, 2021 Aug 22, 2021

Copy link to clipboard

Copied

Can you help me in one thing please? do you have messenger or facebook that I can sen you a video?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 12, 2021 Jan 12, 2021

Copy link to clipboard

Copied

Thank you very much for helping me saving 13000 of processed files!

It might be useful to know, that the files sqlite3.dll, sqlite3.def and sqlite3.exe together with the corrupted file are needed to be in the same directory.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 03, 2021 Jun 03, 2021

Copy link to clipboard

Copied

OMG Polinab You're genius. Thank you Thank you Thank you. Just saved a bunch of wedding pictures. My next move is: Back-up. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 22, 2021 Aug 22, 2021

Copy link to clipboard

Copied

Hello! Can you help? In the last part "Now save the file...let's use TempBadLinesRemoved.sql and exit notepad++ or your preferred editor.", how did you do it? Dont undertand it, could you sent me a video or you can´t right now?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 22, 2021 Aug 22, 2021

Copy link to clipboard

Copied

And the link its not working... 😞

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 22, 2021 Dec 22, 2021

Copy link to clipboard

Copied

LATEST

Thanks mate. Worked for me on LR Classic 2022.

I did notice that some of my collection information was missing but no big deal. Simple case of re-adding it from the library. All my flags were still there so it was a breeze. Cheers

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines