Photos missing after macOS Photos.app update

@Lauren did you also import directly from Photos.app? And update to Catalina recently? If not this might be a different that might be easier to fix using the auto-consolidation.

However, if this is indeed caused by Photos.app moving and renaming the originals (or if the photos have been moved/renamed in a way that makes auto-consolidation impossible) I have written a script find-photos.sh to help deal with this.

Before you start, please make a note of where your project file and your Photos.app library are located. For the following instructions, I’ll assume my Tropy project is at /Users/ariadne/Documents/project.tpy and my photo library is at /Users/ariadne/Pictures/My Photos.photoslibrary.

To be safe, it’s best to be working with a copy of my project file. So, as a first step:

  1. Close Tropy
  2. Make a copy of the project file. In my case, I’ll copy my project file to the Desktop: /Users/ariadne/Desktop/project.tpy.

Next, download find-photos.sh (direct link) and also save it to the Desktop. Now we need to make the script executable. To do this, open Terminal.app and run the following commands:

cd Desktop
chmod 755 find-photos.sh
xattr -d com.apple.quarantine find-photos.sh

To make sure this worked, we try to run the script without any input:

./find-photos.sh

This should print a short usage message and means that everything’s setup correctly.

Finally, let’s also check that we have the right location of the project and photos library:

ls -l project.tpy
ls -l "/Users/ariadne/Pictures/My Photos.photoslibrary"

These two commands should print out the file info for my project file and the contents of the photos library folder. Notice that I’ve used quotes around the path to the photos library: this is necessary, because the path contains a space. In the latest version, the photos library should contain a folder called ‘originals’: this is the folder we’re interested in.

To run the script for real, we need to point it at our project and the photos library. The script will print all necessary update commands to the screen (it currently does not alter the project file directly). This is just a precaution, because it let’s us review the changes first. Instead of printing the update commands to the screen, we can also pipe them into text file, which makes it easier to use it later, so that’s what we’ll do next:

./find-photos.sh project.tpy "/Users/ariadne/Pictures/My Photos.photoslibrary/originals" > update.sql

The > update.sql at the end means that we’ll write all output to this file. If you leave it off, the results will be printed to the screen instead. Running this script may take a while: it has to compute a checksum for each file in your photos library; as rough estimate you can assume this takes about one second per photo in your library.

If the script has terminated, there should now be a file update.sql on your Desktop. When you open the file, it should contain only lines like:

UPDATE photos SET path=’/Users/ariadne/Pictures/My Photos.photoslibrary/originals/3/39F2A58E-AAE2-5984-2C9B-9995724450BF.jpeg’ WHERE id=422;

If this looks good, we can apply the update on our copy of the project database:

sqlite3 project.tpy < update.sql

After this, the copy of project.tpy on the Desktop should be up to date. To see if it works:

  1. Open Tropy. This will open your original project file by default, which is not fixed yet.
  2. Select File -> Open... and select the updated project file on the Desktop (or just drag the file from the Desktop into Tropy) and check if everything looks good.

If the update was successful, close Tropy again; move your original project file to a backup folder (or delete it) and move the updated file back to the original location.