Highlighted

Restoring photo filenames after filesystem recovery

New Here ,
Apr 24, 2020

Copy link to clipboard

Copied

Hi

I've had a bit of a nightmare with my photos. I messed up the filesystem that my photos are located on (a network filestore). I've been able to recover the photos but not the filesystem meaning I have a very large list of photos but have lost their original locations and filenames. My lightroom catalog is fine but obviously now has every photo listed as missing.

 

I was wondering if anyone has any suggestions about how to bulk recover from this situation. I guess I can reimport the files to a new catalog and rename (and relocate?) as I go but I'm not confident they will all end up with original filenames. Is there a way to link the photos from the current catalog with these photos by the exif data?

 

Any help would be greatly apreciated.

 

Thanks

Topics

Import and export, Problem or error

Views

785

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Restoring photo filenames after filesystem recovery

New Here ,
Apr 24, 2020

Copy link to clipboard

Copied

Hi

I've had a bit of a nightmare with my photos. I messed up the filesystem that my photos are located on (a network filestore). I've been able to recover the photos but not the filesystem meaning I have a very large list of photos but have lost their original locations and filenames. My lightroom catalog is fine but obviously now has every photo listed as missing.

 

I was wondering if anyone has any suggestions about how to bulk recover from this situation. I guess I can reimport the files to a new catalog and rename (and relocate?) as I go but I'm not confident they will all end up with original filenames. Is there a way to link the photos from the current catalog with these photos by the exif data?

 

Any help would be greatly apreciated.

 

Thanks

Topics

Import and export, Problem or error

Views

786

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
LEGEND ,
Apr 24, 2020

Copy link to clipboard

Copied

If the file names are different, that's not an easy situation to recover from. Basically, you'd have to re-connect them one-by-one. If just the folder names are different, or just the folder hierarchy is different, but the file names match, then you can reconnect following these instructions: http://www.computer-darkroom.com/lr2_find_folder/find-folder.htm

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Apr 24, 2020

Copy link to clipboard

Copied

hmm ok. Thanks. It was a photorec job so filenames as well as folder names. I've been looking through the exif data and it doesn't look like there is going to be anything to help there. I guess I'm looking it at new catalog and fresh import 😞

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Most Valuable Participant ,
Apr 24, 2020

Copy link to clipboard

Copied

Every year or so we see an unfortunate post like yours.  It's possible to recover the folder structure and file names using photos' and catalog metadata, but it requires some previous experience with command-line scripting.  It doesn't happen often enough, and each circumstance seems to be a little different, to incent a plugin developer to create a plugin to solve this.

 

But if you're technically inclined:

 

First, use the free Exiftool to examine the photos' metadata. No other tools give a complete, authoritative view or provide such power to manipulate photos.

 

Second, recent versions of LR wrote the original file name (but not the folder path) of a photo into the photos' metadata in XMP:PreservedFileName, but this would only be there if you happened to have done Metadata > Save Metadata To File or used the option Catalog Settings > Metadata > Automatically Write Changes Into XMP (which I encourage people to set but few do).

 

Third, you could recover your entire folder and file name structure using the catalog metadata. Use one of the plugins that can dump catalog metadata into a CSV text file (Any Filter, List View, Data Explorer). Dump out the full file path, file name, capture date, camera model, perhaps some other fields (unfortunately, LR won't disclose the file size of missing files). Then use Exiftool to dump out the same fields for the recovered files.

 

Use Excel or (more painfully) your favorite command-line tools to join the two dumped CSV files based on capture date, camera model, etc.  Then from that joined table, write a command-line script that creates the folder hierarchy and moves the recovered files into their original locations.

 

[Use the blue reply button under the first post to ensure replies sort properly.]

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Apr 24, 2020

Copy link to clipboard

Copied

Thanks John. Thats really useful. Sadly I didn't know about those metadata settings so didn't have them set. I've been using exiftool to see if there is any information regarding filenames but alas I'm out of luck there. I'll certainly be taking your advice on those settings in the future though! Hindsight is a wonderful thing

 

Dumping the catalog metadata to csv sounds like a winner though. I'll give that a go. Matching up the date/time stamps sounds like it could work.

 

I really apreciate the assistance.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Apr 24, 2020

Copy link to clipboard

Copied

So what are the filenames in the recovered folders? Are they random filenames, the photos' original names, or what? And in LR, what filenames are shown in the catalogue, and do you see the original filenames?

I ask this way because I have a script that can be used in situations where one is restoring photos but with their original filenames, and when the catalogue shows those filenames in the original filename field.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Apr 24, 2020

Copy link to clipboard

Copied

I've got the filenames in LR yeah. They are showing as missing files but looking at the metadata section shows what they used to be called (and locations). After getting the photos back from the disk with photorec I then ran a sorting python script from here - https://www.cgsecurity.org/wiki/After_Using_PhotoRec 

I'm basically left with a bunch of photos sorted into date relevant directories but with effectively sequention filenames. Great I've got them all back would be better if I can get them to the original filenames and locations so I can associate with the missing images in LR. If you've got a script that can help with that then it would certainly save me some time this evening 🙂

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Apr 24, 2020

Copy link to clipboard

Copied

But which filenames are showing in LR? From what you say about the sequential numbering, it sounds like this isn't going to help you, but I'll explain my solution just in case.

 

If you have renamed files in LR, LR keeps the preserved file name as well as the current filename - see below. Now, imagine now that 200208_0004 Old Nunhead cemetery.raf etc go missing, but somewhere I do have the originals DSCF8844.raf etc. You could fix this one photo at a time, but what my script does is put dummy pictures in the folders where the missing files should be. Because the catalogue no longer thinks the files are missing, one can then use LR's renaming to change all these dummy files back to DSCF8844.raf etc. You then just copy the real DSCF8844.raf over the dummy.

 

Screen Shot 2020-04-24 at 18.21.16.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Apr 24, 2020

Copy link to clipboard

Copied

Ah right. No sadly that's not going to help in this scenario. Its the association between the recovered files and the LR items that's the issue. As the recovered files are just numbers for names now i think the dump to csv and script the rename based on exif might be the way.

 

Thanks for replying though 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...