Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Kimcha

macrumors regular
Original poster
Feb 19, 2012
211
185

Update: You can find the final strategy I have settled on further down in the thread:



Hey guys,

I am considering to switch to iCloud Photo Library, but want to make sure I have a solid backup strategy.

I would like to keep an optimized library on my MBA's internal SSD that uses minimal space and a full library with all originals on an external SSD, but Apple seems to be making this incredibly difficult...

My plan is to create a non-preparatory export of all original photos using osxphotos and then do a cloud backup of both the exported photos and the full library to the cloud using ArqBackup.

But Apple is making this incredibly difficult, because it seems to be almost impossible to have two libraries that are connected to iCloud on one Mac...

  • Only the system library can sync with iCloud and you can have only one
  • Creating a second user "Photos", logging in with the same iCloud account and trying to sync the library doesn't work (You can have only one system library per iCloud account per Mac)
  • Running a VM also doesn't work (at least on M1 macs) as Apple's Hypervisor forbids logging in with iCloud

Update:
I was wrong about "creating a second user doesn't work". It does work and that's the best solution.


So far I have found three options that could work, but are very inconvenient:

1. Install a second copy of macOS on the SSD
I haven't tested this, but it suspect it would work. The problem is that you would have to shutdown your usual system and boot into the Photo system to download the new photos regularly, which creates a lot of friction.


2. Use a second Mac
You can't create a second user on the same Mac with the same iCloud ID and set that user's system library to the external SSD.

But you can do it with a different iCloud user.

So one option would be for my Macbook to download the originals of my girlfriend's iCloud Photo library. And for her Macbook to do the same for mine.

But again, it's a lot of friction and requires you to depend on another mac user.


3. Switch system libraries
Another option would be to disable the system library on the internal SSD's library. Then switch to the full library on the SSD, download all photos, make the backup and then switch back again.

I am a little worried that something could go wrong with this and would cause the entire full library to be re-downloaded.

So I wanted to check in here what you guys are doing and whether you have tried any of these options.
 
Last edited:

rajs

macrumors regular
Jan 21, 2004
100
52
@Kimcha - Did you end up settling with a solution that works for you ? If so would be interested in hearing back on what you did exactly. I am kinda looking into some options for my situation ...

Thanks.

My current issue: want to continue to have FULL offsite backup of my Photos Library (~ 1.2 TB in size containing 131K+ photos and 5K+ videos).

Was able to have that peace of mind when I had an iMac 27" that I ran 24x7x365 with enough local storage to have the full Photos library on local storage whilst also in iCloud. The iMac 27" was getting backed up via Backblaze.

I finally retired the iMac 27" (2011) and replaced it with a MacBook Pro 14" 2021 (1 TB SSD)

Am keeping my Photos library now as an optimized version (reduced storage space) on the MacBook as the internal SSD is just 1TB. I like having this optimized version on the internal SSD as it allows me access to my photos when I am away from my "docked" configuration at home (external monitor, drives, etc..).

So I no longer have a FULL version of the photos library locally. Thus I don't have a FULL backup going to Backblaze anymore.

What I was thinking of doing -- but haven't done yet was one of two options:

a) create a 2nd user account on my MacBook (photo backup) and have it log into my iCloud and have the Photos library it creates "locally" on the MacBook point to the external drive when I am in docked mode at home. That library is a FULL version library (not optimized) and goes to the external drive. It gets backed up via Backblaze.

or

b) Use @RhetTbull solution - osxphotos - in scheduled script that runs every 24hrs when I am "docked" at home and drops a full copy with as much metadata as possible from the iCloud based library to an external drive. That external drive is part of the Backblaze backup. I'd have to come up with the appropriate command line and whether I want to use an Album structure or date structure for the folders: Something maybe like:
osxphotos export /Volumes/ExternalDrive/PhotosLibrary_Backup/ --update --download-missing --use-photokit --export-by-date --exiftool --person-keyword —ramdb
Concern with this option: I think it actually hooks into the local photos library on disk (SSD internal) in this case and since I have optimize storage turned on -- it'll actually force it to download full versions of the photos / videos from iCloud INTO the local on disk library (causing it to try to get up to 1.2TB in size on a SSD that is only 1TB overall *LOL*) and I could run out of disk space. If this is indeed the case (need to research more) - then I can't use this option and need to consider option C below.
or

c) Maybe similar to option b above -- use
iCloud Photos Downloader Tool (haven't investigated enough to know if osxphotos vs iCloud Photos downloader - which would be better. This tool I think directly interfaces with iCloud photo library and ignores the local on disk photos library. Not sure how it handles metadata and additional photos only attributes - such as faces, etc.. for export to local file backup)

My hope is option A might work - as it'll maintain all the meta data as well as additional information such as faces, keywords and all in place within Photos App. Whereas with option B - I'd have to use some of osxphotos export features along with exiftool to write some of the Photos apps faces and keywords into other metadata fields and I'd lose the organization I've done via albums and other things inside of Photos.

Either way though I need to have something soon -- as I don't want to continue to run the risk of losing forever my photos library should something go wrong within iCloud and/or I do something stupid like delete stuff by accident.
 
Last edited:
  • Like
Reactions: Dmitriy Demidov

JamesMay82

macrumors 65816
Oct 12, 2009
1,243
995
@Kimcha - Did you end up settling with a solution that works for you ? If so would be interested in hearing back on what you did exactly. I am kinda looking into some options for my situation ...

Thanks.

My current issue: want to continue to have FULL offsite backup of my Photos Library (~ 1.2 TB in size containing 131K+ photos and 5K+ videos).

Was able to have that peace of mind when I had an iMac 27" that I ran 24x7x365 with enough local storage to have the full Photos library on local storage whilst also in iCloud. The iMac 27" was getting backed up via Backblaze.

I finally retired the iMac 27" (2011) and replaced it with a MacBook Pro 14" 2021 (1 TB SSD)

Am keeping my Photos library now as an optimized version (reduced storage space) on the MacBook as the internal SSD is just 1TB. I like having this optimized version on the internal SSD as it allows me access to my photos when I am away from my "docked" configuration at home (external monitor, drives, etc..).

So I no longer have a FULL version of the photos library locally. Thus I don't have a FULL backup going to Backblaze anymore.

What I was thinking of doing -- but haven't done yet was one of two options:

a) create a 2nd user account on my MacBook (photo backup) and have it log into my iCloud and have the Photos library it creates "locally" on the MacBook point to the external drive when I am in docked mode at home. That library is a FULL version library (not optimized) and goes to the external drive. It gets backed up via Backblaze.

or

b) Use @RhetTbull solution - osxphotos - in scheduled script that runs every 24hrs when I am "docked" at home and drops a full copy with as much metadata as possible from the iCloud based library to an external drive. That external drive is part of the Backblaze backup. I'd have to come up with the appropriate command line and whether I want to use an Album structure or date structure for the folders: Something maybe like:
osxphotos export /Volumes/ExternalDrive/PhotosLibrary_Backup/ --update --download-missing --use-photokit --export-by-date --exiftool --person-keyword —ramdb
Concern with this option: I think it actually hooks into the local photos library on disk (SSD internal) in this case and since I have optimize storage turned on -- it'll actually force it to download full versions of the photos / videos from iCloud INTO the local on disk library (causing it to try to get up to 1.2TB in size on a SSD that is only 1TB overall *LOL*) and I could run out of disk space. If this is indeed the case (need to research more) - then I can't use this option and need to consider option C below.
or

c) Maybe similar to option b above -- use
iCloud Photos Downloader Tool (haven't investigated enough to know if osxphotos vs iCloud Photos downloader - which would be better. This tool I think directly interfaces with iCloud photo library and ignores the local on disk photos library. Not sure how it handles metadata and additional photos only attributes - such as faces, etc.. for export to local file backup)

My hope is option A might work - as it'll maintain all the meta data as well as additional information such as faces, keywords and all in place within Photos App. Whereas with option B - I'd have to use some of osxphotos export features along with exiftool to write some of the Photos apps faces and keywords into other metadata fields and I'd lose the organization I've done via albums and other things inside of Photos.

Either way though I need to have something soon -- as I don't want to continue to run the risk of losing forever my photos library should something go wrong within iCloud and/or I do something stupid like delete stuff by accident.

I don’t think there is a situation that would work to be honest.

Here’s my setup which isn’t ideal but it works for me.

What I do is I have a Lightroom cc library which connects to an external hard drive and that keeps a local copy on the hard drive and also backs up to the adobe cloud which is then on all my device’s.

Next

I then imported the light library which houses all my photos into apple photos on the MacBook Pro as an optimised librery which also syncs to the cloud.

This then allows me 2 cloud back ups and also local back on my external for the Lightroom library. They effectively mirror each other but obviously I have to update each software with new photos… I usually do this once a month..

This is working for me, granted, it costs 9.99 a month for Lightroom but I’m not bothered as it’s another backup for my family photos which are priceless to me
 

Kimcha

macrumors regular
Original poster
Feb 19, 2012
211
185
@Kimcha - Did you end up settling with a solution that works for you ? If so would be interested in hearing back on what you did exactly. I am kinda looking into some options for my situation ...
I am halfway there...
  • I uploaded all my photos to iCloud (stored on an external SSD in original mode)
  • All new photos get downloaded to the mac
  • I regularly run osxphotos to create a copy of the photos in a folder structure
    • Because of APFS the copies of the photos created using osxphotos are not using any additional storage
  • ArqBackup successfully encrypts ands backups both the Photos Library as well as the folder structure to OneDrive
    • Arqbackup also successfully deduplicates the osxphotos copies and doesn't use any additional space
What I haven't tested yet is turning off iCoud and system library status for the library on the SSD and then enabling it for an optimized library on my internal ssd.

a) create a 2nd user account on my MacBook (photo backup) and have it log into my iCloud and have the Photos library it creates "locally" on the MacBook point to the external drive when I am in docked mode at home. That library is a FULL version library (not optimized) and goes to the external drive. It gets backed up via Backblaze.
I have tried this method and it doesn't work. You can have only one system library on the entire mac. Creating new accounts doesn't help.

Even installing in a VM doesn't help, because Apple prevents iCloud logins in VMs.

What might work is installing a second copy of macOS and then rebooting into it, but that's a huge hassle.

b) Use @RhetTbull solution - osxphotos - in scheduled script that runs every 24hrs when I am "docked" at home and drops a full copy with as much metadata as possible from the iCloud based library to an external drive. That external drive is part of the Backblaze backup. I'd have to come up with the appropriate command line and whether I want to use an Album structure or date structure for the folders: Something maybe like:
osxphotos export /Volumes/ExternalDrive/PhotosLibrary_Backup/ --update --download-missing --use-photokit --export-by-date --exiftool --person-keyword —ramdb

Concern with this option: I think it actually hooks into the local photos library on disk (SSD internal) in this case and since I have optimize storage turned on -- it'll actually force it to download full versions of the photos / videos from iCloud INTO the local on disk library (causing it to try to get up to 1.2TB in size on a SSD that is only 1TB overall *LOL*) and I could run out of disk space. If this is indeed the case (need to research more) - then I can't use this option and need to consider option C below.

Yep, I think your concern is correct. It will definitely either do that or error out.

What did work in my testing on a small library is disabling iCloud and system library on the SSD library.

Then make the library on the internal SSD the iCloud library.

Then when you need to download all originals, disconnect the internal library and connect the external one.

The only issue I encountered was that the optimized library would delete all photos that were not downloaded as originals upon disconnect.

So when you connect it again, it would have to download all the previews and so on. But perhaps it could be prevented by creating a copy of it before disconnecting.

I haven't experimented with that yet on a full library.

But I will post here again once I do.
 

rajs

macrumors regular
Jan 21, 2004
100
52
a) create a 2nd user account on my MacBook (photo backup) and have it log into my iCloud and have the Photos library it creates "locally" on the MacBook point to the external drive when I am in docked mode at home. That library is a FULL version library (not optimized) and goes to the external drive. It gets backed up via Backblaze.
I have tried this method and it doesn't work. You can have only one system library on the entire mac. Creating new accounts doesn't help.

Even installing in a VM doesn't help, because Apple prevents iCloud logins in VMs.

What might work is installing a second copy of macOS and then rebooting into it, but that's a huge hassle.

@Kimcha - Thank you for your detailed response. I'd actually headed down investigating looking into option (a) - 2nd user account on same machine with external drive - I'd listed in my original post. I was thinking it would require the LEAST amount of interaction from me on a regular basis to ensure I am getting a full backup.

It actually worked for me - I have a full backup via a 2nd account on my laptop that is syncing to a photo library stored on an external USB drive (download originals to this Mac setting) whilst also having on 1st account (primary user account) a separate and distinct photo library (file/directory/pkg) set as optimize Mac storage which is stored on the internal SSD. Both 2nd account and 1st account use the same iCloud account. Working well and Backblaze has had no issues backing it all up.
 
Last edited:

Kimcha

macrumors regular
Original poster
Feb 19, 2012
211
185
@Kimcha - Thank you for your detailed response. I'd actually headed down investigating looking into option (a) - 2nd user account on same machine with external drive - I'd listed in my original post. I was thinking it would require the LEAST amount of interaction from me on a regular basis to ensure I am getting a full backup.

It actually worked for me - I have a full backup via a 2nd account on my laptop that is syncing to a photo library stored on an external USB drive (download originals to this Mac setting) whilst also having on 1st account (primary user account) a separate and distinct photo library (file/directory/pkg) set as optimize Mac storage which is stored on the internal SSD. Both 2nd account and 1st account use the same iCloud account. Working well and Backblaze has had no issues backing it all up.
That’s amazing! What macOS version are you using?

And are you sure both libraries are set as the iCloud Photo Library and system library at the same time?

Are you sure that when you switch to the second account, it doesn’t disconnect the first? And vice versa?
 

rajs

macrumors regular
Jan 21, 2004
100
52

Kimcha

macrumors regular
Original poster
Feb 19, 2012
211
185
@rajs was totally right and you can have two different System Photo Libraries as well as iCloud libraries on one mac if you use two user accounts.

So here is a documentation of my entire Photos backup workflow now.

The goal

  • Have an optimized Photos Library that uses very little space on the internal drive of my Macbook Air
  • Have a full version of the Photos Library with all originals on an external SSD (Samsung T7)
  • Have a non-proprietary backup with all metadata in a simple folder structure
    • In case the Apple Photos library is corrupted
    • Or I decide to switch to a different photo management in the future
  • Have an off-site / cloud backup of both the Apple Photos Library as well as the folder structure using Arq Backup
This way...
  • I always have access to all my photos on my MBA and iPhone without needing a lot of expensive, internal storage
  • If iCloud Photos gets somehow corrupted, I have a local library with all originals on my SSD
  • If the local Photos Library on the SSD also gets corrupted at the same time , I have all originals and their metadata as a folder structure
  • If I ever decide to move to a different photo management solution, I can easily do it with the
  • If somehow against all odds I also break or lose the SSD at the same time, I still have a full backup of both the Photos Library and the exported originals in the cloud as an Arq Backup

Step 1: Optimized library on the MBA's internal drive & full library on the external SSD​

This is fairly easy to achieve:
  • Backup your full library on the external SSD (if you have it already)
    • Simply copy the library to the same drive
    • Duplicating the libraries should not use any additional space if you are using APFS.
    • So there is no downside to this action
  • Optimized library on internal mac drive
    • Create an empty library on your internal SSD and set it to iCloud optimized
    • Enable `Use as System Library`
      • You may see a warning saying that it will disconnect the previous sytem library and that photos that have not been downloaded, will be deleted.
      • This is ok and you shouldn't worry about it, since you created a backup
    • Enable `iCloud Photos -> Optimize Mac Storage`
  • Full library on external drive
    • Backup the new optimized library (just in case)
    • Create a second account on your Mac and name it something like `Photos`
    • Log in to that account
      • Make sure it uses the same iCloud account as your primary mac user account
      • Either create a new library or open the existing library with all originals on your external drive
      • Enable `Use as System Library`
        • You may see a warning saying that it will disconnect the previous sytem library and that photos that have not been downloaded, will be deleted.
        • This is ok and you shouldn't worry about it, since you created a backup
      • Enable `iCloud Photos -> Download originals to this mac`
      • It might take a while for Apple Photos to download all your photos or to check whether everything is synced
    • Switch back to your primary user account
    • Check if the optimized library is still syncing and updating (it should be)
You can now use the optimized library in your default mac's user account. And to use the full library, simply switch the user account and open Photos there.

Both libraries will sync with iCloud and download new photos.

Make sure to login with the `Photos` account regularly to download the originals of all new photos you have shot on your iPhone.


More detailed instructions:

You can find more detailed instructions in @rajs post:

He is the one who came up with this solution.


Step 2: Export all photos and metadata into normal directories (Non-proprietary backup)​

Why this is needed​

This step ensures that, if your Apple Photos library ever gets corrupted, you still have a backup of all original photos and their metadata (keywords, favorite tags, ...).

This may seem unlikely, but it does happen from time to time. I personally had both iPhoto and Aperture libraries get corrupted and it was a big pain to fix them.

It will also make it very easy to switch to another photo management solution if you ever want or need to.

How to create a non-proprietary backup using osxphotos​

For this we will use the absolutely phenomenal open source tool osxphotos by @RhetTbull.


A note on storage space

Make sure that your external drive is using Apple's relatively new APFS filesystem format.

With APFS copied or duplicated files don't use any additional storage on the physical drive. This means you can create an export of all your photos without using any additional storage.


Osxphotos a terminal tool, so you will have to get your hands a bit dirty, but it's not too difficult. Just follow the installation instructions on the tools github page.

Prepare the folder structure​

Bash:
# Change into the location of your Photo library
# Adjust to the name of your SSD name
cd "/Volumes/Photos/"

# Create the folder where the exported photos will be stored
mkdir -p photo_library_export/photo_library_backup/

# Create a tmp folder for osxphotos
mkdir -p photo_library_export/osxphotos_tmp/

Create the config​

Create a config in the file `photo_library_export/osxphotos_backup.conf`:
INI:
[export]
# Only export new or updated files.
update = true

# Cleanup export directory by deleting any files which were not included in this export set. For example, photos which had previously been exported and were subsequently deleted in Photos.
# WARNING: This will delete any files in the export directory that were not part of the export.
# Be careful with this and always test osxphotos with the `--dry-run` option first
cleanup = true

# Write a report of all files that were imported for further analysis later
report = "osxphotos_report_backup.sqlite"

# If used with --report, add data to existing report file instead of overwriting it.
append = true

# Specify Photos database path.
# Adjust this
db = "../Photos.photoslibrary"

# Specify alternate temporary directory.
# This ensures osxphotos runs faster when your library is on an external SSD.
tmpdir = "osxphotos_tmp"

# Template for specifying name of output directory in the form
# Photos will be stored separate folders for each month like:
# photo_library_export/photo_library_backup/2022/2022-11/
directory = "{created.year}/{created.year}-{created.mm}"

# Specify the color theme to use for –verbose output. Valid themes are ‘dark’, ‘light’, ‘mono’, and ‘plain’.
theme = "light"

# Create sidecar for each photo exported that contains keywords and so on
sidecar = [ "xmp",]

# Drop the photo’s extension when naming sidecar files. By default, sidecar files are named in format ‘photo_filename.photo_ext.sidecar_ext’, e.g. ‘IMG_1234.JPG.xmp’. Use ‘–sidecar-drop-ext’ to ignore the photo extension. Resulting sidecar files will have name in format ‘IMG_1234.xmp’.
# This ensures the sidecar file will be recognized by more third party apps like lightroom
sidecar_drop_ext = true

# Use person in image as keyword/tag when exporting metadata.
person_keyword = true

# Set XMP:Rating=5 for favorite images and XMP:Rating=0 for non-favorites
favorite_rating = true

# Add additional keywords to xmp
#   - A keyword for each album the photo is in
#   - Add the automatic keywords Apple Photos determined for the photo, such as `sunset`, `cat` and so on
#   - Add an `is_favorite` keyword for favorite photos
#   - Add keywords for different photo types, such as `is_screenshot`

keyword_template = [
    "Album: {folder_album}",
    "{label}",
    "{favorite?is_favorite}",
    "is_{media_type}",
]

Run osxphotos​

Now you are ready to actually run osxphotos and export the photos (but look at the warning below first):
Bash:
# Change into the directory you created earlier
cd photo_library_export/

# Run osxphotos
# Consider using the additional options `--verbose --dry-run` on the first run
osxphotos export photo_library_backup/ --load-config osxphotos_backup.conf




IMPORTANT:
The config above will export all new photos that haven't been exported yet (when running repeatedly), but it will also delete all files in the export directory that are not part of the export.

So don't mix manual backups / export and automated exports. Make sure the `photo_library_backup/` directory is used exclusivly by osxphotos and no other files are added to it

It is recommended to run the command with the `--verbose --dry-run` parameters any time you make changes to the osxphotos config.

This will ensure osxphotos doesn't actually export or delete anything. Instead it will just show you what it would do if you didn't use the `--dry-run` parameter.


Step 3: Create an offsite / cloud backup of the library and exported photos​

The final step is to create a backup in the cloud. This ensures that even if your house burns down or you lose your external drive with your full Apple Photos library, you still have a backup in the cloud of all your photos and originals.

For this I recommend the backup software ArqBackup.

Arq allows you to use any cloud storage space you already have for regular, end-to-end encrypted backups:

  • It keeps multiple versions of your files, so even if you delete something, you will still have a backup (unlike cloud storage solutions).
  • It encrypts everything before uploading it. So your cloud storage provider will not be able to see any of your private files and folders.
  • It also deduplicates everything to make sure duplicate copies of the same file do not use additional space. So if you backup both the Apple Photos Library as well as your osxphotos export directory, you won't use any additional space.
I am using it with Microsoft's OneDrive. You can get Microsoft 365 Family, which includes MS Office, 1TB OneDrive and other stuff for 5 members.

You can frequently find deals for an effective price of $5 per month. This essentially gives you 5tb of cloud storage that you can use for various uses, including the backup of all your macs and photos.

Alternatively, you can also use wasabi or one of the many other cloud storage providers.
 
Last edited:

rajs

macrumors regular
Jan 21, 2004
100
52
@Kimcha Thanks for the details on your steps for osxphotos. Going to add that onto the same volume as my full library since it's an APFS encrypted volume. The best part is it shouldn't take up any real additional space besides the metadata on either my APFS volume or even on the BackBlaze backup.
 
  • Like
Reactions: Kimcha

Garafraxa

macrumors newbie
Mar 3, 2009
15
7
This is exactly the solution I’ve been looking for!
I see this was based on Monterrey and is over a year old. Any updates or corrections for 2024 (Sonoma)? Thanks!
 

Kimcha

macrumors regular
Original poster
Feb 19, 2012
211
185
This is exactly the solution I’ve been looking for!
I see this was based on Monterrey and is over a year old. Any updates or corrections for 2024 (Sonoma)? Thanks!
The process itself is still working perfectly on Sonoma.

But I encountered a bug where Apple Photos wouldn’t download the originals on Sonoma to the full library for some reason.

But I used osxphoto to create an album with all undownloading (“missing”) photos and then used the Apple Photos export originals function to force a download.

That solves the problem in case you come across it too.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.