{"id":1453,"date":"2015-12-29T01:10:33","date_gmt":"2015-12-28T14:40:33","guid":{"rendered":"https:\/\/robertrath.com\/serendipity\/archives\/1453-lightroom-catalog-backups-a-better-archiving-solution.html"},"modified":"2016-01-21T00:22:03","modified_gmt":"2016-01-20T13:52:03","slug":"lightroom-catalog-backups-a-better-archiving-solution","status":"publish","type":"post","link":"https:\/\/robertrath.com\/serendipity\/archives\/1453-lightroom-catalog-backups-a-better-archiving-solution.html","title":{"rendered":"Lightroom Catalog Backups &#8211; A Better Archiving Solution"},"content":{"rendered":"<a href=\"\/serendipity\/\" title=\"Robert&apos;s Ramblings\"><!-- s9ymdb:2014 --><img loading=\"lazy\" decoding=\"async\" class=\"serendipity_image_center\" width=\"1024\" height=\"210\" src=\"\/serendipity\/uploads\/LightRoomBanner1024.png\" alt=\"\" \/><\/a><br \/>\n<br \/>\nWhen using Lightroom&#8217;s integrated catalog backup feature the catalog is compressed using the Zip algorithm.<br \/>\nThe Zip algorithm will typically reduce the size of the saved backup to one tenth the size of the original catalog file.<br \/>\n<br \/>\nFor small catalog files, ie anything up to 500MB, the Zip algorithm is fine with backups being around 50MB each.<br \/>\nStill, if you backup daily that 50MB per day backup can grow very quickly into a very large archive collection.<br \/>\n<br \/>\nFor large catalog files, ie anything over 1GB (mine is up to 28GB), Z-Zip&#8217;s higher compression ratio and performance is a better choice with compressed backups being one hundredth of the size.<br \/>\nZ-Zip&#8217;s very high compression on Lightroom catalog files is a combination of its ability to handle very large files and the inherent structure of SqlLite database files (catalog).<br \/>\n<br \/>\nOf course regardless of the archiving method used, the archived catalog backups need to be stored in three independent locations just as you would to backup and protect your images.<br \/>\nFor simplicity I keep my Lightroom catalog backups with my photos so that the same process which backups up my photos looks after my catalog archives.<br \/>\nMy working Lightroom catalog is located elsewhere and never included in the photo backups.<br \/>\n<br \/>\n\n<strong>1. Download and Install 7-Zip<\/strong><br \/>\n<br \/>\n7-Zip can be downloaded from http:\/\/7-zip.org\/ Ensure you download and install the correct version 32-bit or 64-bit for your operating system.<br \/>\nThe latest version for me was 7z1512-x64.exe which has an MD5 sum of 822b366bb37a9628cafff5bfaf186998 (if you need to check validity).<br \/>\n<br \/>\nInstalling Z-Zip will provide a fully featured file compression utility which integrates nicely into the Windows file explorer.<br \/>\nThe the Lightroom catalog can easily be backed up in Windows File Explorer however for the purpose of automated Lightroom backups we will be using the command line utility.<br \/>\n<br \/>\nIf you are interested in the nitty gritty of the 7-Zip command line see the article at http:\/\/www.dotnetperls.com\/7-zip-examples<br \/>\n<br \/>\n\n<strong>2. Automation<\/strong><br \/>\n<br \/>\nLightroom provides some options to automatically backup the catalog on closing Lightroom either every time or the first time Lightroom is used for the day.<br \/>\nFurthermore, Lightroom backups are created using a directory name which contains the date and time the backup was created.<br \/>\n<br \/>\nIn order to mimic this behavior I have written a script which creates the same format directory structure for the Z-Zip archive created.<br \/>\nTo used the script presented below you will need to manually modify the &#8216;source&#8217; and &#8216;destination&#8217; paths and files. All other setting should be fine.<br \/>\n<br \/>\nI keep the backup script in the same folder as my catalog backups but it can live anywhere you like as full paths are specified.<br \/>\n<br \/>\nTo use the script you can simply launch if from Windows File Explorer, or a desktop shortcut you have created, immediately after you have closed Lightroom.<br \/>\n<br \/>\nBetter still, setup an automation rule in Windows Task Scheduler so that the Lightroom catalog is archived every night (preferably just before your main photo backups take place).<br \/>\n<br \/>\n\n<strong>3. The Backup Script (copy and paste everything from this section into a new file called &#8216;archive_lightroom.cmd&#8217;)<\/strong><br \/>\n\n<br \/>\nREM ===========================================================<br \/>\nREM        Lightroom Backup Script Version 1.1 (c)2015 R.M.Rath <br \/>\nREM ===========================================================<br \/>\n<br \/>\nREM History<br \/>\nREM Version 1.1 &#8211; Changed archive tool to 7z.exe.<br \/>\nREM Version 1.0 &#8211; Original version using WinRAR.<br \/>\n<br \/>\nREM This backup script will create a Lightroom archive as a &#8216;7z&#8217; file using<br \/>\nREM the &#8216;7-Zip&#8217; program (installed separately) instead of Lightroom&#8217;s internal<br \/>\nREM &#8216;Zip&#8217; archiver. The advantage of using &#8216;7z&#8217; files is that they will be<br \/>\nREM around 10 times smaller than &#8216;Zip&#8217; files for large Lightroom catalogs.<br \/>\n<br \/>\nREM When used a backup directory structure will be created similarly to<br \/>\nREM Lightroom&#8217;s date and time labeling. Four &#8216;set&#8217; variables are used to<br \/>\nREM configure the backup script for the correct files and destinations.<br \/>\n<br \/>\nREM This script is ideally run daily using a scheduler such as Microsoft&#8217;s<br \/>\nREM &#8216;Task Scheduler&#8217; utility (installed in all Windows systems) at a time<br \/>\nREM most likely to not have Lightroom running. If Lightroom is running<br \/>\nREM when this script executes it will simply abort.<br \/>\n<br \/>\nREM =========== Configure the source here ====================<br \/>\n<br \/>\nset SourcePath=D:\\Lightroom6\\Lightroom Robert Rath Collection\\<br \/>\nset SourceFile=Lightroom Robert Rath Collection-2.lrcat<br \/>\n<br \/>\nREM =========== Configure the destination ====================<br \/>\n<br \/>\nset ArchivePath=D:\\photos\\Lightroom\\Backups\\<br \/>\nset ArchiveFile=Lightroom Robert Rath Collection-2<br \/>\n<br \/>\nREM =========== Make no changes below this line ===============<br \/>\n<br \/>\nset BackupApp=C:\\Program Files\\7-Zip\\7z.exe<br \/>\nset BackupTime=%time: =0%<br \/>\nset BackupDir=%ArchivePath%%date:~10,4%-%date:~7,2%-%-%%date:~4,2% %BackupTime:~0,2%%BackupTime:~3,2%\\<br \/>\n<br \/>\nmd &#8220;%BackupDir%&#8221;<br \/>\n&#8220;%BackupApp%&#8221; a -spf -mx9 -mmt &#8220;%BackupDir%%ArchiveFile%&#8221; &#8220;%SourcePath%%SourceFile%&#8221;<br \/>\n<br \/>\nREM =========== Old WinRAR Version ===============<br \/>\n<br \/>\nREM set BackupApp=c:\\Program Files (x86)\\WinRAR\\RAR.exe<br \/>\nREM set BackupTime=%time: =0%<br \/>\nREM set BackupDir=%ArchivePath%%date:~10,4%-%date:~7,2%-%-%%date:~4,2% %BackupTime:~0,2%%BackupTime:~3,2%\\<br \/>\n<br \/>\nREM md &#8220;%BackupDir%&#8221;<br \/>\nREM &#8220;%BackupApp%&#8221; a -t -ep &#8220;%BackupDir%%ArchiveFile%&#8221; &#8220;%SourcePath%%SourceFile%&#8221;<br \/>\n<br \/>\n<br \/>\n","protected":false},"excerpt":{"rendered":"<p>When using Lightroom&#8217;s integrated catalog backup feature the catalog is compressed using the Zip algorithm. The Zip algorithm will typically reduce the size of the saved backup to one tenth the size of the original catalog file. For small catalog files, ie anything up to 500MB, the Zip algorithm is fine with backups being around &#8230; <a title=\"Lightroom Catalog Backups &#8211; A Better Archiving Solution\" class=\"read-more\" href=\"https:\/\/robertrath.com\/serendipity\/archives\/1453-lightroom-catalog-backups-a-better-archiving-solution.html\" aria-label=\"Read more about Lightroom Catalog Backups &#8211; A Better Archiving Solution\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-1453","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/robertrath.com\/serendipity\/wp-json\/wp\/v2\/posts\/1453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/robertrath.com\/serendipity\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robertrath.com\/serendipity\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robertrath.com\/serendipity\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/robertrath.com\/serendipity\/wp-json\/wp\/v2\/comments?post=1453"}],"version-history":[{"count":0,"href":"https:\/\/robertrath.com\/serendipity\/wp-json\/wp\/v2\/posts\/1453\/revisions"}],"wp:attachment":[{"href":"https:\/\/robertrath.com\/serendipity\/wp-json\/wp\/v2\/media?parent=1453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robertrath.com\/serendipity\/wp-json\/wp\/v2\/categories?post=1453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robertrath.com\/serendipity\/wp-json\/wp\/v2\/tags?post=1453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}