• Welcome to the Lightroom Queen Forums! We're a friendly bunch, so please feel free to register and join in the conversation. If you're not familiar with forums, you'll find step by step instructions on how to post your first thread under Help at the bottom of the page. You're also welcome to download our free Lightroom Quick Start eBooks and explore our other FAQ resources.
  • Stop struggling with Lightroom! There's no need to spend hours hunting for the answers to your Lightroom Classic questions. All the information you need is in Adobe Lightroom Classic - The Missing FAQ!

    To help you get started, there's a series of easy tutorials to guide you through a simple workflow. As you grow in confidence, the book switches to a conversational FAQ format, so you can quickly find answers to advanced questions. And better still, the eBooks are updated for every release, so it's always up to date.

Restoring lost image files SD card

Joined
Aug 19, 2019
Messages
1
Lightroom Version
10.2 Classic
Operating System
  1. Windows 10
I have a situation where I have lost image files in my library and the only backup I have is the original SD cards, with the original camera file names. When the files originally downloaded the file names were changed during import but the catalog metadata still has the original camera file names. What is the best way to restore/download the files to match them with the lightroom library catalog name so I don't lose all the file edit data??
 
Joined
Oct 8, 2007
Messages
5,839
Location
London
Lightroom Experience
Power User
Start with making a backup of the catalogue, and then use Explorer to copy all those files off the card and into a folder on your hard drive.

I will copy below a script which has instructions about how to set it up and how to run it. You will need to create a little jpeg called dummy.jpg which is stored directly on your Windows desktop.

For each missing file, the script copies this jpeg to the missing file's location with the missing file's exact name and file extension. Despite being really a jpeg, LR is fooled into thinking that the file is no longer missing and you can then rename it back to the original file name. Then in Explorer copy the real files and paste them into the folder over the fool jpegs.

John

copy after here....

Code:
--[[
SETUP INSTRUCTIONS
Temporarily copy this into Notepad/TextEdit and save it onto your desktop and call it "YOURFILENAME.lua".

Now you need to create a scripts folder:
    In Lightroom, choose Lightroom > Preferences (Mac OS) or Edit > Preferences (Windows).
    Choose the Preset tab and select Show Lightroom Presets folder.
    Create a folder in the Lightroom folder called Scripts.
    Copy the "YOURFILENAME.lua" script into the Scripts folder.
    Quit and reopen Lightroom.
    You should now see a little scripts menu to the right of the Help menu.
      
--]]

------------------------------DON'T CHANGE BELOW

local LrPathUtils = import 'LrPathUtils'
local LrFileUtils = import 'LrFileUtils'
local LrTasks = import 'LrTasks'
local LrDialogs = import 'LrDialogs'

local SEP
if MAC_ENV then SEP = '/' else SEP = '\\' end

LrTasks.startAsyncTask( function()   
    srcPath = LrPathUtils.getStandardFilePath( 'desktop' ) .. SEP .. "dummy.jpg"
    if LrFileUtils.exists( srcPath ) ~= "file" then
        LrDialogs.message("Stopped", "Save a jpeg on the desktop - call it dummy.jpg - and  then run this again")
        return false
    end
    local catalog = import "LrApplication".activeCatalog()   
    photos = catalog:getTargetPhotos()   
    filePaths = {}
    for i, photo in ipairs(photos ) do
        if photo:checkPhotoAvailability() == false then
            destPath = photo:getRawMetadata('path')   
            parentFolderPath = LrPathUtils.parent( destPath )       
            if LrFileUtils.exists( parentFolderPath ) == false then
                LrFileUtils.createAllDirectories( parentFolderPath  )
            end
            LrFileUtils.copy( srcPath, destPath )
          
        end
    end
    LrDialogs.showBezel("Finished", 5)
end)
 
Joined
Jul 2, 2015
Messages
11,251
Location
Netherlands
Lightroom Experience
Power User
Lightroom Version
Another way of doing this: create a new temporary catalog, import the images from the memory card into this catalog, while copying them to the location you used previously and rename them during import using the same template. Then, if you restart Lightroom with the original catalog, everything should be there again. Trash the temporary catalog folder, you no longer need it.
 
Joined
Oct 8, 2007
Messages
5,839
Location
London
Lightroom Experience
Power User
I would certainly try Johan's solution before mine.
 
Top