Skip to main content
Inspiring
September 25, 2018
Question

Help restoring original photo library after accidental deletion

  • September 25, 2018
  • 2 replies
  • 1156 views

I have a Lightroom catalog with over 38,000 photos and videos in it. I have it backed up twice, but recently had a perfect storm that resulted in me accidentally deleting all the original photos. Both of my backups failed, so I was cleaning off a disk to make room to make a copy of everything before I setup my backups on new media again. I screwed up and deleted my main photos folder (this is on a Mac). Cue lots of colorful metaphors and cries to have cloud backup.

I immediately quarantined my external drive so nothing changed on it, and I used a recovery tool to try and get things back. Of my 38205 files in my original catalog, the tool restored 34821 file with their original file name and folder location.  It also found over 40k raw files, where raw files do not have the original filename or folder location (these are not raw files in the photo sense). Only the file content is there. Looking around, it looks like I have just about all the files I need, but I'm now looking for some advise on how best to rebuild my catalog and relink all the files.

My questions:

After I put back the 34821 restored files, I will have two issues. First, there will be a lot of missing files which I'm hoping to find in the raw file content  from above. Second, since this process restored deleted files, there will be a lot of files in the folder that are not in the catalog.

1. Does Lightroom have a way to locate files in the main photo folders that are not in the catalog? I know I can just ignore them, but the perfectionist in me will struggle with that.

2. How best can I restore all those missing links? I have most of the original content, but the filenames are all changed. My original thought was to import all those renamed files into a new folder and hope that Lightroom will clear out all the duplicates. That would at least limit how many files I need to search for the missing photo.

Thanks!

This topic has been closed for replies.

2 replies

dj_paige
Legend
September 25, 2018
After I put back the 34821 restored files, I will have two issues. First, there will be a lot of missing files which I'm hoping to find in the raw file content  from above ... Looking around, it looks like I have just about all the files I need, but I'm now looking for some advise on how best to rebuild my catalog and relink all the files.

If you do it right, there won't be any missing files. Just put them in the exact same folder they were in before the deletion. If your backups mirror the folder structure of the originals (and they should), then this is a trivial thing to do, takes you a minute or two and everything is ready to go. No rebuilding the catalog, no re-linking, no importing.

Inspiring
September 25, 2018

There will be missing files. My original /Photos folder had ~38000 files in it according to Lightroom. My restored /Photos folder has ~35000 files in it. Lightroom should automatically find the 35k files I restored. Then I will be left with a bunch of files I explicitly deleted -- Lightroom doesn't know about them, and I will have a bunch of files whose filenames and original locations are unknown. I will need to find them by image and capture date. It might be worth writing a script given that capture date to the second should be close enough to match most any image I have. That's what I'm hoping anyway.

Inspiring
September 25, 2018

I think I have a way to remove the already explicitly deleted files. If I do an import/add from my main /Photos directory, and I ensure that duplicates are not imported, I should be able to add a keyword to all the added files. Once things are imported, I can view the keyword, and delete the files (again).

I can't try it yet though. My files are still copying from my restore disk.

Regarding the script I mentioned above, I'm a software developer so scripting is not scary for me. However, I'm not aware of tools that will allow me to script against a Lightroom catalog. Are there any?

Edit: Looks like I could reverse-engineer the SQLite database that is Lightroom's catalog, or I figure out how to write my own plugin to do this. Any other options?

john beardsworth
Community Expert
Community Expert
September 25, 2018

DaveDuprePhoto  wrote

Second, since this process restored deleted files, there will be a lot of files in the folder that are not in the catalog.

You mean files that you had deliberately deleted?

DaveDuprePhoto  wrote

1. Does Lightroom have a way to locate files in the main photo folders that are not in the catalog? I know I can just ignore them, but the perfectionist in me will struggle with that.

What you can do is synchronize the parent photo folder and import those files. They will then all be shown in Previous Import. However, be careful with synchronizing the folder - it's not a way to dig yourself out of a hole and can often worsen the problem.

I would make certain to run a backup at each stage of resolving this, just in case you make another mistake.

DaveDuprePhoto  wrote

2. How best can I restore all those missing links? I have most of the original content, but the filenames are all changed. My original thought was to import all those renamed files into a new folder and hope that Lightroom will clear out all the duplicates. That would at least limit how many files I need to search for the missing photo.

What filenames does the original content have? Is it using the filename from the camera? If so, is the original filename shown in the catalogue's Metadata panel? Test this with a few images at first. If so, I can let you have a script that puts a dummy file in the missing files' place, letting you rename the dummy files back to the original filenames - you then copy the original files over the dummy files and LR will now be pointing to the real files with their original names. But before you grab this lifebelt, answer my questions

Inspiring
September 25, 2018

Yes, the files I deliberately deleted from Lightroom while reviewing a bunch of new photos. This would have been before I screwed up and emptied my trash.

The original content basically has random filenames. Since the directory metadata is all gone, my recovery gives the files names like 207780854-207796083001.JPG or CANON_281299472-2813005971026.JPG. Note, the vast majority of the lost files are JPGs from my early days before I had a DSLR, or they are scanned negatives/slides. I think the early files got clobbered in the directory info as part of moving things to the trash.

Guess what I just bought today? Yes, a cloud backup solution. Obviously, a TimeMachine backup to a NAS and a synced second HD are not enough to protect me from myself given the TimeMachine backup decided it needed to start over, and the second external disk died at the same time.