How to move referenced originals in Photos for Mac

Warning!! I’ve only just hacked this solution together and I don’t fully understand the ramifications of my actions yet. If there are any, I will update this post.

First, a bit of context on how I use Photos for Mac (Photos).

I do not allow Photos to store my original files within its “package”. I have my reasons. When I import photos I check the box labeled “Keep Folder Organization”. This way, I can keep my photos in a directory structure of my choice rather than how Photos chooses to organize them.

I wanted to take one of my photo libraries (I have two) on the go with me on a portable external hard drive that I can keep in my bag. After much searching I could not find anything that explained how to move my original photos from one external hard drive to another and have Photos recognize this change.

So finally, I had a few moments to spare, and I figured I would dig under the hood of Photos to see how it kept the references to these files and see if I could update those references to the new location.

Photos uses a SQLite database to store much of the information it needs to do what it does. Things like facial recognition, album names, keywords, etc. are all stored in a heap in this database. In a few locations, it turns out, it also stores the path to each individual original photo in your library.

So far (one night, as of this writing) this solution has seemingly worked for me. I will continue to play around with the results to see if I can uncover some adverse side effect. Until then, here are the steps I took to move an entire original photo library onto a portable external hard drive.

Photos’ SQLite database viewed in Sqlitebrowser
  1. Make a copy of your .photoslibrary file. Just in case.
  2. Copy all the original photos from one drive to the other. For me, this was simple. I keep my photo library originals in separate directories so I can copy a single directory and grab them all. For me, this was /Volumes/Hard Drive 1/Carbonite Photo Storage/Photography Projects/ to /Volumes/Hard Drive 2/Photo Archive/Photography Projects/
  3. Open the Photos.sqlite database found within the Photo Library package contents. Secondary-click on your .photoslibrary file, select Open Package Contents and navigate to database/Photos.sqlite (I used Sqlitebrowser)
  4. Update the ZNAME and ZVOLUMEUUIDSTRING fields in the ZFILESYSTEMVOLUME table. To get the new values, open the System Information app on macOS and find the new values for your hard drive under Hardware > Storage. I could not find ZVOLUMEUUID anywhere so I left it as-is. No idea if this will come back to bite me.
  5. Update the ZFILESYSTEMBOOKMARK table with the relative paths to the originals. To do this, I ran the following SQL – UPDATE ZFILESYSTEMBOOKMARK SET ZPATHRELATIVETOVOLUME = REPLACE(ZPATHRELATIVETOVOLUME, 'Carbonite Photo Storage', 'Photo Archive')
  6. Update the ZGENERICASSET table with the new paths for all photos on the ZDIRECTORY field. To do this, I ran the following SQL – UPDATE ZGENERICASSET SET ZDIRECTORY = REPLACE(ZDIRECTORY, 'Hard Drive 1/Carbonite Photo Storage', 'Hard Drive 2/Photo Archive')
  7. Save the Sqlite database file.
  8. Open Photos!

One way to tell if this worked for you is to open Photos, choose a photo from your library, and select “Show Referenced File in Finder”. This will open a Finder window with the selected file in its location. If it opens to the new hard drive you copied your originals to, it worked.

I’m going to be using this library a fair bit in the coming days and so I hope that if there are any issues with this approach I will find them quickly and can update this post. See also the comments in case others try this and leave some feedback.

    Thanks so much for posting this! After returning to my Photos library after a couple of months of not touching it, I found that all of the referenced files on a particular volume (thousands of them) were showing as offline, and Photos would not let me reconnect them (choosing “Locate Referenced File…” did nothing – the directory selection window would not appear).

    Using your guide, I was able to discover the root cause: I renamed the volume a couple of months ago, and Photos was having trouble finding those files with the old volume name stored in all the ZGENERICASSET table entries, possibly because the ZFILESYSTEMVOLUME table’s entry for the volume’s UUID didn’t match its current name.

    Having edited the database manually, all of the photos are showing correctly in Photos now!

    Kevin – I am super happy that you were able to fix your issue. Believe me when I say that I can understand your situation!


    Hi Colin,

    Thanks for the article. I am dealing with a similar problem and I found out how to retrieve the ZVOLUMEUUIDSTRING.

    Run the following command in the terminal
    $ diskutil info | grep “APFS Volume Group”

    To find out the disk identifier, run
    $ diskutil list
    and look for your hard drive. In my case, the output was this:
    5: APFS Volume MacintoshHD 15.3 GB disk1s5

    So getting the UUIDSTRING in my case was running:
    $ diskutil info disk1s5 | grep “APFS Volume Group”

    I appreciate the insight! I am hoping that someday Apple will add a way to move libraries between volumes. But I’m not holding my breath!


    Thank you so much, Colin and Kevin, your solutions helped me solve a problem with my Photos library as well. In my case it was a volume on a new MacBook that was named differently from the volume I had in my old MacBook. The update of the ZGENERICASSET table with the new paths for all photos on the ZDIRECTORY field, as you Colin described, did the trick for me. So thank you very much, I am so happy that my Photos library is back and working as well as before.

    Seem to have worked but only partially: for many photos the app says “missing file” and proposes to find the original, although the show referenced photo in folder does work and shows it properly.
    I noticed that in the ZFILESYSTEMBOOKMARK table there is also a ZBOOKMARKDATA field containing a BLOB that still contains the old location, thus not matching the ZPATHRELATIVETOVOLUME field…

    Thanks for commenting. Obviously, some of the underlying data store could have changed in the last two years. So I wonder if I should revisit this post some time soon.

    I wish Apple would provide a “move library” or “relocate library” button for those of us that use Apple Photos in this way.


    Thank you for the instructions here. Im in a similar situation trying to move the location of my referenced file, but have no experience with SQL/coding.

    When I try to update ZGenericAsset, I get an error “Results: No Such Table: ZGENERICASSET” and dont see that table in the database structure. Any thoughts?

    Hello Philip! You are doing this a few years, and a few versions of Photos, later than I did. So I wonder if that table is even in the database any longer? Can you post a screenshot of all of the table names?


    Here’s a link to a screenshot list of tables. It doesn’t look like the table is in the database any longer. Any thoughts for a workaround or solve?


Leave a Reply

Your email address will not be published.