Renaming recovered files.

New Here ,
Dec 03, 2020

Copy link to clipboard

Copied

Hello!

Not too long ago I accidentally erased an external drive with 4TB of photos on it. Luckilly I was able to recover all of them. Unfortunately I was not able to recover their original filenames, and have not been able to merge them with my original lightroom catalogue that had all of the edits for each file.

The recovery software I used was able to pull the EXIF data, and name the file accordingly, e.g. "(2017-01-06 16-36-57)Canon Canon EOS 5D Mark III-5760x3840-3972227720.CR2".  I am loath to go through the entire library and rename files individually. I was wondering if there was a way to match the metadata information (camera, date, and time), and then rename the recovered file to the original filename that is stored in the Lightroom database, so I can then re-merge the file into the catalogue without losing the edits.

Thanks for your help!

TOPICS
How to, Import and export, Mac, SDK, Sync

Views

79

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

Renaming recovered files.

New Here ,
Dec 03, 2020

Copy link to clipboard

Copied

Hello!

Not too long ago I accidentally erased an external drive with 4TB of photos on it. Luckilly I was able to recover all of them. Unfortunately I was not able to recover their original filenames, and have not been able to merge them with my original lightroom catalogue that had all of the edits for each file.

The recovery software I used was able to pull the EXIF data, and name the file accordingly, e.g. "(2017-01-06 16-36-57)Canon Canon EOS 5D Mark III-5760x3840-3972227720.CR2".  I am loath to go through the entire library and rename files individually. I was wondering if there was a way to match the metadata information (camera, date, and time), and then rename the recovered file to the original filename that is stored in the Lightroom database, so I can then re-merge the file into the catalogue without losing the edits.

Thanks for your help!

TOPICS
How to, Import and export, Mac, SDK, Sync

Views

80

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
Dec 03, 2020 0
LEGEND ,
Dec 03, 2020

Copy link to clipboard

Copied

How about Restoring that drive from your Back Up copy of those images?

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...
Dec 03, 2020 0
Adobe Community Professional ,
Dec 03, 2020

Copy link to clipboard

Copied

Would this help?

LRC > Library > Rename then edit the Filename dropdown menu

revert.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...
Dec 03, 2020 0
Most Valuable Participant ,
Dec 03, 2020

Copy link to clipboard

Copied

This issue comes up couple times a year.  The only solution I know of requires experience with command-line scripting:

 

1. Use the Any Filter plugin's Sort command (or Listview or LR/Transporter) to export a CSV file from the catalog containing three columns: the capture date/time, the camera model, and the file path recorded in the catalog.

 

2. Use Excel, Google Sheet, or a text editor with macro capabilities to transform the CSV file into a Windows batch file / Mac OS shell script containing lines of the form:

 

mv recovered-file path-recorded-in-catalog

 

I don't know what date/time your recovery software may have included in the recovered filenames -- it could be EXIF:DateTimeOriginal (capture date) or another of the many dates recorded in metadata.  So you'll have to experiment with that. 

 

[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...
Dec 03, 2020 1
New Here ,
Dec 06, 2020

Copy link to clipboard

Copied

@johnrellis 

So far I've been able to recover the files on a separate drive, and rename the files based on the capture time stamp and camera model from the EXIF tags. I then used a SQLite GUI to query the LrC database, and return a table with a compatible filename, original filename, and original path. 
Screen Shot 2020-12-06 at 7.15.15 PM.png

I then exported the results to a CSV file. Do you know of a way to create a shell script to rename the files to their original filename, create the necessary folders, and move the files into those folders? Is there a program out there that could automate it for me?

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...
Dec 06, 2020 0
Most Valuable Participant ,
Dec 06, 2020

Copy link to clipboard

Copied

When I've done similar tasks in the past, I open the CSV in Excel and add a final column to contain the appropriate shell command for each row. I use the Excel CONCATENATE function and other string functions to construct the shell commands. Then I copy that column into a text file in a text editor.

 

I don't know of any program that does this.

 

[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...
Dec 06, 2020 0