# Restore original filenames



## rctneil (Apr 24, 2013)

Hello,

Before I used LR, I stored all my photos in a simple folder structure and renamed each one depending on it's content. Now they are all organised in LR, I want to restore to the old original camera created filename. I see the "Original Filename" field in the metadata panel. How can I select a bunch of images and restore the old filename to them all?


----------



## Jim Wilde (Apr 24, 2013)

Select them all, then press F2 (or Library>Rename) and in the Rename dialog, click the down arrow to select Edit and the Filename Template Editor will open....just select "Original Filename" in the Image Name box, press the Insert button so that the template has only that field, as per the attached example, as you should be done.


----------



## rctneil (Apr 24, 2013)

Brill. Will try that when I get back home


----------



## erro (Apr 24, 2013)

"Original filename" in LR means the filename as it was imported into LR. If you have renamed the files before import, outside of LR, then that is the original name as far as LR knows. In that case you can't get back to the camera generated filename. "Original filename" will only let you "undo" renaming done inside LR.

Also, if you import images into LR and rename them in the import dialog, then the renamed filename is what LR treats as "original filename". So if you have images with the normal camera generated name IMG_4722.JPG and import that, and rename it in the import dialogue to 20130424 001.JPG then you can never get back to IMG_4722.JPG since LR will now treat 20130424 001.JPG as the original name. This is the reason I always import without renaming. By doing so I can rename as much as I want inside LR, but I can always get back to IMG_4722.JPG since LR knows that is the original name.


----------



## rctneil (Apr 24, 2013)

Yes I realise this. The I mused have renamed them inside lightroom then. Can't remember it but from what you have said then I must have done

Thanks

Just at a pub quiz at the moment which is highlighting my surprising lack of knowledge so will try this when I get home

Neil


----------



## rctneil (Apr 24, 2013)

Worked perfectly!


----------



## Hoggy (Apr 29, 2013)

I believe this is actually a bug.  I reported it on the adobe site and an employee thanked me for reporting it.  Maybe that's standard fare though - to get us to shut up. 
I hope people go there and also report it as a bug.  I'm really sick of having to do this in 2 steps all the time - which seems to be what many will do..  In other words, I really don't think this is a 'feature'.  It makes trying to rename files later on almost impossible.  I haven't totally settled on what naming standard to follow yet - so now I have a slight mess regarding files I renamed during import before knowing this tidbit of information.  Redeeming me is at least a main feature I settled on early is having a database-style date near or at the beginning of the filename.  That's the good news.

Bad news is that LR's renaming facilities to do more complex file renaming is still rather lacking, making it too much trouble to try renaming all those old files.


*Please people - go and report this as a bug so it gets fixed ASAP!*  As far as I'm concerned it completely is.  It would make no sense to me that it should purposely work the way it does right now.  And it's getting really annoying.


----------



## Mark Sirota (Apr 29, 2013)

Hoggy said:


> I believe this is actually a bug.



I'm confused -- what, specifically, do you think is a bug? I see lots of pronouns ("it", "this") and not enough nouns.


----------



## Victoria Bampton (Apr 29, 2013)

I can't find your adobe site post either - what's your username there?


----------



## Hoggy (Apr 30, 2013)

Oh sorry.. Here it is..  http://feedback.photoshop.com/photo...tm_medium=email&utm_source=reply_notification

As far as why..  Is that I just can't see how it would be normal behavior.  I've seen too many people saying that they do the renaming after import specifically to avoid that behavior.  Plus it would make some of the tokens in the renaming 'dialog' rather pointless, like 'original filename' or 'original suffix'.


----------



## Victoria Bampton (Apr 30, 2013)

So the filename marked Original Filename should actually be called Import Filename.  Are you renaming on import, and then trying to recreate the filename as it was on the card?


----------



## Hoggy (Apr 30, 2013)

Not quite sure what you mean in the first sentence.  The "Original Filename" field in the LR panel is what I've been understanding that Adobe is calling the "xmpMM:: Preservedfilename" field as, but I could be wrong of course.

But yeah - I was originally renaming on import until I started reading that people were doing it in two steps to make sure the preservedfilename field would get the actual name from the card.  So that's about when I also started doing it in 2 steps.  I do notice that after doing it in two steps, the file can be renamed as much as you want in LR and using the 'original filename/suffix' tags would then always keep referring to the name from the card that was imported.


----------



## Victoria Bampton (May 1, 2013)

Yep, I'm with you. We often call that the 'import filename' - i.e. the filename it has directly after importing (which is not necessarily the same as the name on the card).  And I agree 'Original Filename' ought to be the card name, and there ought to be another called Import Filename for the current state.


----------



## Steve Maller (Apr 6, 2017)

Bless the interwebs and the google. I love it when a well-formed gquery lands squarely on the answer to my question.


----------



## Victoria Bampton (Apr 12, 2017)

Welcome to the forum Steve! Glad to hear it helped!


----------



## bsmale (Mar 7, 2020)

I have a problem on a similar line:  I've just started using LR Classic 9.2, and can't for the life of me figure out how to show the 'original file name'  in the Metadata panel.  That field was always showing in my previous version, but not this one.  I'm sure there is an embarrassingly easy setting to switch on, but I just can't find it.  Any suggestions?


----------



## Jim Wilde (Mar 7, 2020)

"Original Filename" in the Metadata Panel only appears (automatically) when a file has been renamed using Lightroom *after* it was imported, i.e. if you rename as part of the import process you will only see the File Name field. Furthermore, the "Original Filename" field would itself only appear in a couple of the Metadata Panel display types (EXIF & IPTC, Location). However, the Metadata display "Default" now displays the field "Preserved File Name", which I believe will show the pre-import filename (assuming you rename during import).

I'm not seeing any issues with 9.2 in this regard.


----------



## bsmale (Mar 7, 2020)

Thanks Jim.  Unfortunately I don't think this is the case with my files.   I always import first, convert to dng, cull the duds, and then rename.  The glitch might be that i imported these files in to an earlier version of LR (I forget exactly which version, but it was fairly recent), and with this new version i decided to 'clean house' a bit and start with a new catalog.  I would have thought that all the meta data would have survived intact (including the original camera file names), but apparently not.


----------



## Jim Wilde (Mar 7, 2020)

If by "start with a new catalog' you mean that you imported all the images into a new catalog, then I can't say I'm surprised. AFAIK, Lightroom writes the filename of the imported files (as they are at the time of import, not as they may have been several rename iterations before) into the catalog database. That name becomes the "Preserved File Name", which will be the same as the File Name in the Metadata panel until/unless you subsequently rename again. 

I don't know if the original SOOC file name is retained in the file's EXIF header when you rename a file, but if so it would seem that Lightroom doesn't access that during import if you're not seeing it anywhere in the Metadata panel.


----------



## bsmale (Mar 7, 2020)

ahh.  that makes sense.  Yes, i made a new catalog, and imported all my existing images to the new catalog.  Too bad it's not something that survives in the metadata.  It would be handy to have sometimes.  (like now!  :-0 )  Thanks for the help.  b


----------



## apostolis.platanias (May 7, 2020)

Hello!!
I lost my renamed nef cause a disk failure. I have the files in my backup disk but with the camera filename.
So i have the catalog with the renamed photos and the files with the original filename. Is there any way to restore the catalog with the original filename?
I can't rename in lightroon because does not find the file...


----------



## johnbeardy (May 7, 2020)

Can we see a screenshot of one image so I can be sure of your situation?

What I want to see is if you have the "preserved file name" as in my screenshot. If it is the situation I think, I would be able to share with you a script which copies a dummy file  to Whatever.cr2, making LR think Whatever.cr2 is not missing (as many as you want in one go). This means you can use LR's renaming to rename the missing files to the preserved file name, and you then replace the renamed files with the original camera filename files.


----------



## apostolis.platanias (May 7, 2020)

Yes!
i have the preserved file name which is the same with the camera filename!


----------



## johnbeardy (May 7, 2020)

Good, tomorrow I will put the details together and maybe do a little video. It's not very complicated, but you have to understand the steps.


----------



## apostolis.platanias (May 7, 2020)

Ok! Thank you very much!!!


----------



## rctneil (Apr 24, 2013)

Hello,

Before I used LR, I stored all my photos in a simple folder structure and renamed each one depending on it's content. Now they are all organised in LR, I want to restore to the old original camera created filename. I see the "Original Filename" field in the metadata panel. How can I select a bunch of images and restore the old filename to them all?


----------



## johnbeardy (May 7, 2020)

Are you familiar with simple programming - JavaScript, VB, Applescript etc. You won't need to know anything, but it helps me know how much I will need to explain. And did my steps above make sense to you?


----------



## apostolis.platanias (May 7, 2020)

Unfortunately no! I don’t know anything about programming! But i think that i can follow your “guide”


----------



## johnbeardy (May 7, 2020)

That's OK. I'll make it as clear as I can, and make sure you backup your catalogue and try the method on a few pictures first. What OS are you using?


----------



## apostolis.platanias (May 8, 2020)

Mac os 10.14.6


Sent from my iPhone using Tapatalk


----------



## johnbeardy (May 8, 2020)

OK, I attach the script which has installation instructions at its top. I've also recorded a quick video which shows the whole process https://www.youtube.com/watch?v=dpz9gVVaGuI

Ensure you backup your catalogue first, put the dummy.jpg on the desktop, and test the full workflow on a few pictures. And if it isn't clear, please ask.


----------



## apostolis.platanias (May 8, 2020)

Hi again!
I don't know what going wrong, but this don't work on me!
First of all, when i run the script it never create a new folder in desktop with the "dummy" files and the script just replace the files i import to lightroom with "dummy" file with the renamed name... not with the preserved name!!!
For example: the camera file is the p85_1475.nef, the rename file that i don't have it is G&I-2046. When i run the script, just replace the P85_1475.NEF with a G&I-2046.nef


----------



## johnbeardy (May 8, 2020)

That's correct. My missing folder was on the desktop, yours may not be missing, and may be elsewhere. Yes, the script does put the dummy files with the renamed names - that is explained in the video. You probably need to watch the second half again.


----------



## apostolis.platanias (May 8, 2020)

Yes!!!
All the confuse in my mind just because my folder is there and don't missing...
Now it works!!
Thank you very much


----------



## johnbeardy (May 9, 2020)

Great. Sometimes people are in your problem because they lost the folders too, so one step is to rebuild the original folder paths - but sometimes one can show too much and just confuse the viewer.


----------

