@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.