… once and for all.
If you are a photographer that uses Lightroom you might have encountered a catalog problem. Sometimes they just clear up by themselves, but it may occur that you lose some of your precious work along the way.
The first thing you should try upon encounter of a message like this one above, is to delete the
.lock file. Together with the catalog (
.lrcat) you should find
.lock files. Well, delete or change the extension of the latter.
If this does not resolve the problem, and instead you’re more f**** than before, then this is what happened to me and you’re on the right post.
Let’s play the magic
As it turns out, Lightroom catalogs are simply sql tables underneath. So by extracting it into a
.sql file and recreating a new catalog from it will, in fact, solve all our problems with no data loss. To do this, use the command line tool sqlite3.
** If you don’t have this command, probably you need to download the command line utilities that fit your operating system from SQLite’s home page (http://www.sqlite.org).
- Open a terminal window
- Dump the
$ echo .dump | ./sqlite3 ~/catalog.lrcat > ~/catalog.sql
- Recreate a new catalog from it:
$ ./sqlite3 -init ~/catalog.sql ~/new_catalog.lrcat
sqlite3 (without ./) if your sql utility was already installed in your system root.
NOTE 2: Also,
~/ stands for your home path. Replace it with the path to the catalog as seen from the folder you’re in at the moment.
So simple, yet so powerful. I don’t understand why Lightroom’s automatic repair system won’t try doing this!