Lightroom catalog clean-up

The size of the Lightroom catalog increases over the time not only because of importing new images, but also if you develop or even when you export images. This is mainly due to the history in the development module.

Introduction

Lightroom catalog clean-upThe Lightroom catalog not only saves the sorage places of all imported images, but also of course the Exif metadata and a history on every development step and data about exporting an image via an publishing service or on the dard drive.

The main problem is that those entries are not stored by a reference like usual in a database. Every images carries the text “Exported on harddrive Date”. Such entries are stored in the history of the development modul even though exporting an image doesnt’t have anything to do with the development history or does an export change the image?

I already showed howto reduce the size of the catalog in an older article. But this method has the disadvantage that it deletes all the history data, but Lightroom itsself doesn’t offer any other option.

Ich habe dazu ein Video erstellt:

The database

Lightroom catalog clean-upThe Lightroom catalog is a SQLite database which is used in a lot of applications for local storage purposes. Such a database can be viewed and queried with SQL commands outside the Lightroom application.

There is a command line tool sqlite3, but i advice you to use the GUI based tool  DBBrowser for SQLite, which is also available for  Windows.

And before you play arround with DBBrowser tool make sure you have a backup of your Lightroom catalog just in case.

The Lightroom database

The Lightroom catalog ends on  .lrcat, while normally SQLite database have a filetype of  .db. But you select all files and now you can open the Lightroom catalog. The first tab lists the database structure with all tables defined. The table of our interest is  Adobe_libraryImageDevelopHistoryStep

Lightroom catalog clean-up

 

The top row with the names of the fields can function as a filter to the database table. Just tpye in name the text “Export”. Then the browser lists all rows containing this word.

Now we switch to the tab “SQL Query” and insert the following command:

SELECT * FROM Adobe_libraryImageDevelopHistoryStep WHERE name LIKE “Export%

Lightroom catalog clean-upIn this example you see that more than 11000 rows contain this text which is added every time you export an image. Since the full text is repeately stored in the database it is clear that one can save a couple of Megabyte with deleting these entries.

Delete entries

To delete these entries we execute the command

DELETE FROM Adobe_libraryImageDevelopHistoryStep WHERE name LIKE “Exporti%

Lightroom catalog clean-upWith this command all entries are deleted in combination with an export of an image. The same is true for publishing images. Here you filter for the expression  “Published%“.

There are more entries which have almost no informatio in the history table like for example “Settings inserted” if you copied development settings to a selection of images.

Finally you execute the compact command to really delete these entries. After closing the database this saves storage space of arround 110 MB in my case.

Conclusion

Manipulating the database with such a tool shouldn’t be done without having a working copy of your Lightroom catalog. But it is the only way to reduce the size of the database and not deleting all history entries.

ciao tuxoche

Add a Comment

Your email address will not be published.