- Joined
- Jan 18, 2009
- Messages
- 2,587
- Location
- Fort Myers, FL
- Lightroom Experience
- Advanced
- Lightroom Version
- Classic
- Lightroom Version Number
- LR 7+ (Classic)
- Operating System
- Windows 10
Lightroom uses SQLite as its database, so your "catalog" is a big SQLite database.
Lightroom will back that up, and test its integrity, and optimize all on its own. That's good. Do it. However, it is never wise to trust any one program, what follows is a very brief outline of how to test your catalog for SQLite integrity. This MAY find errors Lightroom misses and indicate corruption (and almost certainly it is real corruption). This MAY miss lightroom-specific tests that Lightroom does -- it is possible for the database to have perfect integrity but have bad data in it that Lightroom would finds in ites test. In other words, doing both is a goodness -- both should pass. If either fails, you have issues.
Also, and perhaps most importantly -- TEST YOUR BACKUPS. Because otherwise you never know if they are broken. This gives you a quick way to tell if they are valid SQLite databases.
To test your catalog:
Step 1: Download command line utilities for SQLite from the authoritative source: SQLite Download Page You want to get the "Precompiled Binaries for Windows" and specifically the "SQLite Tools" command line bundle, or the same for Mac OS (no real choices there). You do not want the windows "DLL".
Note from here on my comments are for windows -- I don't speak MAC but I think they are more or less identical except for terminology perhaps.
Step 2: Unzip the downloaded zip file, and put the file "sqlite3" somewhere convenient, like on your desktop (it ends in .exe on windows, I think no add-on in Mac).
Step 3: Figure out where your Lightroom catalog is, the full path/name. open up the Edit, Catalog Settings to find it, e.g. in my example below the path is "T:\LightroomCatalog\LR7.lrcat". You need to know that whole thing, and it may be best to put it in quotations. Then close lightroom ( you can not check integrity with lightroom open).
Step 4: Open a command prompt (or whatever they call it in Mac), and enter first the path to where you put "sqlite3" and the catalog name and the rest of this line as shown. Case may matter. You should get "ok", or a list of problems (or if you type something wrong hopefully an error you can make sense of and type it right). My sqlite3 was on my desktop, so I put "desktop" in first, which is where windows has it.
That's it -- if you get OK, you are good. If not... worry, maybe start a new thread here (or reply here if you cannot get it to run at all).
TEST YOUR BACKUPS NEXT.
Step 1: Backups are zip files also (at least recent versions are). So first unzip one and put it SOMEWHERE ELSE. DO NOT UNDER ANY CIRCUMSTANCES PUT IT OVER TOP OF YOUR REAL CATALOG. **** PUT IT SOMEWHERE ELSE ****. So I dragged mine to my desktop, here's how it looked on Windows to do so. Notice that I had the zip file open looking at it, and dragged the contained LR7.lrcat file onto my desktop. BE SURE YOU PUT THIS SOMEWHERE OTHER THAN YOUR CATALOG, SOMEWHERE YOU CAN DELETE IT WHEN DONE. Clear? Putting it on top of your existing catalog wipes it out, do not do that. If you do it, do not tell me you were not warned!
Step 2: Now run the exact same command as above, but on the backup file instead where ever you put it. Here I used a catalog that I knew was bad so you can see what kind of info a failure shows. The actual errors are not really helpful to most people, but that you get any means that backup is BAD and cannot be used to restore. Note it's always a good idea to test integrity before trying to do a restore, but it is much more useful to test integrity BEFORE you need a restore so you can get a better backup!
So again...
If you test with SQLITE3 and it says it is bad -- ti is bad. Get help. If it says it is "ok" it MAY be OK, continue testing (and backing up) with Lightroom as well. Do both.
And test your backups -- Lightroom NEVER tests your backups, unless you need to restore, and then it is too late.
Linwood
Ps. This should work for older lightroom's a swell, SQLite generally adjusts downward to old versions. Very old LR backups are not zipped, just hit the file directly if not.
Lightroom will back that up, and test its integrity, and optimize all on its own. That's good. Do it. However, it is never wise to trust any one program, what follows is a very brief outline of how to test your catalog for SQLite integrity. This MAY find errors Lightroom misses and indicate corruption (and almost certainly it is real corruption). This MAY miss lightroom-specific tests that Lightroom does -- it is possible for the database to have perfect integrity but have bad data in it that Lightroom would finds in ites test. In other words, doing both is a goodness -- both should pass. If either fails, you have issues.
Also, and perhaps most importantly -- TEST YOUR BACKUPS. Because otherwise you never know if they are broken. This gives you a quick way to tell if they are valid SQLite databases.
To test your catalog:
Step 1: Download command line utilities for SQLite from the authoritative source: SQLite Download Page You want to get the "Precompiled Binaries for Windows" and specifically the "SQLite Tools" command line bundle, or the same for Mac OS (no real choices there). You do not want the windows "DLL".
Note from here on my comments are for windows -- I don't speak MAC but I think they are more or less identical except for terminology perhaps.
Step 2: Unzip the downloaded zip file, and put the file "sqlite3" somewhere convenient, like on your desktop (it ends in .exe on windows, I think no add-on in Mac).
Step 3: Figure out where your Lightroom catalog is, the full path/name. open up the Edit, Catalog Settings to find it, e.g. in my example below the path is "T:\LightroomCatalog\LR7.lrcat". You need to know that whole thing, and it may be best to put it in quotations. Then close lightroom ( you can not check integrity with lightroom open).
Step 4: Open a command prompt (or whatever they call it in Mac), and enter first the path to where you put "sqlite3" and the catalog name and the rest of this line as shown. Case may matter. You should get "ok", or a list of problems (or if you type something wrong hopefully an error you can make sense of and type it right). My sqlite3 was on my desktop, so I put "desktop" in first, which is where windows has it.
That's it -- if you get OK, you are good. If not... worry, maybe start a new thread here (or reply here if you cannot get it to run at all).
TEST YOUR BACKUPS NEXT.
Step 1: Backups are zip files also (at least recent versions are). So first unzip one and put it SOMEWHERE ELSE. DO NOT UNDER ANY CIRCUMSTANCES PUT IT OVER TOP OF YOUR REAL CATALOG. **** PUT IT SOMEWHERE ELSE ****. So I dragged mine to my desktop, here's how it looked on Windows to do so. Notice that I had the zip file open looking at it, and dragged the contained LR7.lrcat file onto my desktop. BE SURE YOU PUT THIS SOMEWHERE OTHER THAN YOUR CATALOG, SOMEWHERE YOU CAN DELETE IT WHEN DONE. Clear? Putting it on top of your existing catalog wipes it out, do not do that. If you do it, do not tell me you were not warned!
Step 2: Now run the exact same command as above, but on the backup file instead where ever you put it. Here I used a catalog that I knew was bad so you can see what kind of info a failure shows. The actual errors are not really helpful to most people, but that you get any means that backup is BAD and cannot be used to restore. Note it's always a good idea to test integrity before trying to do a restore, but it is much more useful to test integrity BEFORE you need a restore so you can get a better backup!
So again...
If you test with SQLITE3 and it says it is bad -- ti is bad. Get help. If it says it is "ok" it MAY be OK, continue testing (and backing up) with Lightroom as well. Do both.
And test your backups -- Lightroom NEVER tests your backups, unless you need to restore, and then it is too late.
Linwood
Ps. This should work for older lightroom's a swell, SQLite generally adjusts downward to old versions. Very old LR backups are not zipped, just hit the file directly if not.
Last edited: