ūüŹě Force macOS Photos.app to¬†download whole iCloud library

Problem

Many, many times I had issues with iCloud photos syncing. The¬†last time I tried to¬†save my whole Photos library (~180GB) on an¬†external SSD drive with no¬†luck: some originals for¬†the¬†latest photos were saved, while another 99% of¬†data was still in¬†the¬†cloud only. What is important is that the¬†settings were correct: I ticked ‚ÄėDownload Originals to¬†this Mac‚Äô, but¬†this didn‚Äôt change anything.

It drove me nuts completely because I was planning to work with my new travel clip, so I needed all my photos and videos on hand, locally.

After many attempts to¬†find a¬†workaround, I realized that ‚Äėsmart‚Äô algorithms mainly cause these issues, but¬†not¬†poor Wi-Fi/internet connection, or¬†low bandwidth on iCloud infrastructure (ha-ha).

At the same time, I’m still not ready to use another cloud storage to save & sync my photo library. iCloud’s native look & feel and fair monthly prices are the benefits that still make me use it for a while.

Now I’m thinking about a pet project, that will allow me to force synchronization of the Photos library on my Mac using Apple Photokit. According to several forum threads, this app will be useful for many Apple users.

Solution

As¬†for¬†now, fortunately, I‚Äôve finally found an¬†easy way to¬†download all my iCloud photos using 3rd party tool called osxphotos. This is a¬†powerful command-line utility to¬†work with your iCloud photos. It doesn‚Äôt have a¬†special command like ‚Äėstore all my photos locally‚Äô, or¬†‚Äėforce sync all my photos with iCloud‚Äô, however, you can run an¬†export command with specific attributes which will allow you to¬†download all photos without actual exporting, and¬†it works!

6 easy steps

  1. Open Terminal (search for Terminal in Spotlight or look in /Applications/Utilities)
  2. Download and¬†install Homebrew¬†‚Äď cool CLI package manager for¬†Mac:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Using Homebrew, download and¬†install pipx¬†‚Äď package manager for¬†python:
brew install pipx
  1. Install osxphotos:
pipx install osxphotos
  1. Once completed, create temp folder:
mkdir ~/osxphotosTemp
  1. Then run export command:
osxphotos export ~/osxphotosTemp --dry-run --download-missing --use-photokit --verbose

Command explanation:
osxphotos export¬†‚Äď run export command. In¬†our case we don‚Äôt need to¬†perform actual export, that‚Äôs why we also adding --dry-run param
~/osxphotosTemp¬†‚Äď we need to¬†specify some folder for¬†‚Äėexport‚Äô. It‚Äôll stay empty, since --dry-run param is provided
--dry-run¬†‚Äď tell osxphotos to¬†simulate the¬†export process without actual exporting. Despite this, originals will still be downloaded from iCloud
--download-missing¬†‚Äď our key to¬†solving the¬†issue¬†‚Äď all missing photos and¬†videos will be downloaded from iCloud servers
--use-photokit¬†‚Äď Apple‚Äôs Photokit will be used
--verbose¬†‚Äď make osxphotos display sync details

‚ĄĻÔłŹ If you have a¬†very large photo library, something could go wrong during command execution. You can re-run the¬†command again and¬†again until the¬†whole library will be synced to¬†your Mac.
¬†298¬†  2022   how-to   icloud   macos   tips