- Export photos in a selected format. In the Photos app on your Mac, select the item you want to export. Choose File Export Export number Photos. Click the Photo Kind pop-up menu and choose the file type for the exported photos. JPEG creates small-size files suitable for use with websites.
- Nov 23, 2016 Connect the new drive and quit the Photos program before you copy the library. Next, go to your Mac’s Home folder and open the Pictures folder. Drag the PhotosLibrary.photoslibrary file to the new drive’s desktop icon (or onto its icon in the window’s sidebar). If you hold down the Command key while you drag.
- There are any number of reasons that one may want to export their Mac Photos (formerly iPhoto) library, including that they want to give it to someone else, they want to duplicate it on another machine, or they want to back their entire Photos library up to another location.
- Mac Photo Library Export
- Mac Photos Export Entire Library
- Export From Photos App
- Mac Photos Library Export Photos
- Mac Photos Library Export To Mac
Apr 23, 2015 How to import, export and share photos with Photos for Mac Sharing. After selecting a photo or video or a group or photos or videos. Photos lacks an 'Open In' feature, which would be a convenient way to open. If you have turned on iCloud Photo Library, then your iPhone. How to transfer your iPhone or Mac Photo library to an external drive. By AppleInsider Staff Wednesday, January 31, 2018, 04:40 pm PT (07:40 pm ET) Storing an entire collection of photographs in.
March 2018, Andreas Bentele
This is a headless program (with command line interface) to export all photos of the macOS Photos library to a filesystem folder. Like Apple's Time Machine, it backup's the data in folders containing full backups, while using hard links to minimize disk usage.
You may ask: why another backup solution in addition to Time Machine, which already backups my Photos library?The answer is: Time Machine is one of the best backup solutions I know. But the macOS Photos Library has it's very special database structure - it's in parts file system based, but not intended to open it with any other program but Apple's Photos. Time Machine does nothing else but backup this database to an external disk. Backups are not portable to another system but a Mac with Photos.
Using Time Machine to backup my photos is what I've done for many years till I lost some of the most important photos in my Photos library (maybe by own mistake). Because of Time Machine automatically removes old backups to get new disk space, the photos were also deleted from my backups. Fortunately I found the photos in a backup of my old Aperture library. This opened my eyes, so I decided to implement a small program which implements the following requirements, partly inspired by how Time Machine works:
- export all original and modified photos
- generate a human readable folder structure containing all folders, albums, smart albums, moments, etc. from the Photos library (usable with any other program on any platform)
- full exports: each export creates a new folder named after the current date
- make use of hard links whenever possible instead of copying files, to minimize additional disk usage e.g. due to consecutive full backups or photos contained in several albums
- never delete old backups (I want to be able to decide which old backups should be deleted, or if I want to buy a disk with more space for my backups)
- performance and robustness: the backup of my around 30.000 photos should be done in less than an hour (currently it takes around 30 minutes); if it doesn't succeed, the program should at least let me know the error
- keep it simple: no complex interface to configure things, no complex configuration
- provide two export modes: 1. Time Machine like backup, 2. snapshot export with no extra disk usage if export is on same file system
There are two possible general use cases:
- SnapshotPhotosExporter: export all your photos, e.g. to share them with other programs or devices like your TV or other non-Apple devices, share them in the cloud etc.; if the export folder is on the same file system as the Photos Library, there is no extra disk usage
- IncrementalPhotosExporter: backup all your photos while keeping the previous backups, like with Time Machine (I would suggest to add a cron job to trigger it daily or weekly)
You also can combine both: export to local disk using SnapshotPhotosExporter. Make a backup using Time Machine to an external disk. Then use the IncrementalPhotosExporter to export the photos to the same external disk while using hard links to the already exported photos in the Time Machine backup instead of copying all photos again (see parameter baseExportPath for more details).
I believe some other people who think backups are very important could make use of it as well, so I've decided to make the code open source. Any feedback is appreciated, especially pull requests with improvements.
This program was not my first try. I've tried out some other solutions before, that didn't work at all:
- export photos within the Photos app; this didn't work because of several annoying bugs of Photos (I've already reported the bugs to Apple). Also the export in Photos doesn't fulfill the requirements discussed above.
- searched for another existing external solution including scripts, Objective-C or Swift based programs posted in the WWW; there were no real existing solutions but only some discussions on the same topic which showed me that this was not only a problem of me
- then I've written a script using the Applescript language which automates the Photos app and calls shell scripts to do the file system based things; while the script was rather expressive and short, it had very bad performance and bad robustness because of annoying bugs in the Photos app and Apple's scripting architecture as well. Also the Photos API was rather limited at the time I used it.
The final step was to re-implement everything using Apple's latest programming language Swift and the MediaLibrary Framework. The result is a very robust, performant and maintainable solution compared to the previous solutions.
Currently the program doesn't have any arguments and no user interface.You have checkout the project, open it in Xcode, open MainExporter.swift
and modify the parameters, most important targetPath
. Be sure the target path is on a file system which supports hard links. You are free to customize the code to your needs, but it's not required.
Then run the program with Xcode, or compile the project and use the executable to export your photos.
Normally, the exporter adds the timestamp of a photo to the exported photo's filename. Use the keyword 'export-no-date' in Photos to omit the timestamp in the filename.
If you move the exported folder, be sure to recreate the Latest
link, because it would be broken after moving the folders.
Parameters of the exporter
All parameters can be applied both to the SnapshotPhotosExporter and to IncrementalPhotosExporter.
- exportMediaGroupFilter: filter for the media groups (default: all media groups are exported)
- exportPhotosOfMediaGroupFilter: filter for photos in a media group (default: all media groups are exported)
- exportMediaObjectFilter: filter for media objects (default: all media objects are exported)
- exportCalculated: set to false if calculated photos should not be exported (default: true)
- exportOriginals: set to false if calculated photos should not be exported (default: true)
- baseExportPath (only IncrementalPhotosExporter, optional parameter): the path to an already existing export folder on the same device; example: export all photos using SnapshotPhotosExporter to your local disk or SSD; create a backup using Time Machine; additionally export the photos using IncrementalPhotosExporter to the same device as your Time Machine backup. Then you would set the baseExportPath to the export folder within your Time Machine backup, to link the exported photos with the photos of your Time Machine backup to save disk space.
- deleteFlatPath (only SnapshotPhotosExporter, optional parameter): true if the .flat folders should be deleted after the export (default:true; disable deleting if you want to use the export folder as base for an incremental export, see parameter baseExportPath)
- macOS 10.14 'Mojave' (tested by the maintainer)
- macOS 10.13 'High Sierra' (should work, but untested, unsupported)
The program starts with reading all metadata of the System Photos Library. This is implemented in MetadataLoader.swift using the MediaLibrary Framework. While the MediaLibrary Framework would allow to read the iPhoto Library, the current sourcecode focuses on the Photos Library.
The rest is implemented in PhotosExporter.swift and inherited classes SnapshotPhotosExporter.swift and IncrementalPhotosExporter.swift.
The two implementations are different:
- IncrementalPhotosExporter.swift: After loading the metadata, a folder
InProgress
is created. This is a temporary folder where the program copies all exported folders and files to; . After the export of all files has been succeeded, the folder is renamed to the current date formatted with the date patternyyyy-MM-dd HH-mm-ss
. Also a symbolic link (alias) to this folder namedLatest
is created to know which files to link on the next export. If an error occurs during the backup, theInProgress
folder will be left, until the next run of the program finally deletes it. - SnapshotPhotosExporter.swift: it uses an
InProgress
folder, too. If the files of the Photos Library and the target folder are on the same file system, the files are not copied to theInProgress
folder. Instead, hard links are created, to minimize disk usage. After the export of all files has been succeeded, the folder is renamed toCurrent
, while the oldCurrent
folder is removed before.
The main part - exporting the albums and photos - is done in two phases: the first phase is to export all original and modified photos to a folder named .flat
. The second phase creates all sub-folders based on the albums, smart albums etc. in the Photos Library.
This screenshot should give an idea about the generated folder structure:
While exporting media files to the .flat
folder, the program checks if a file has been changed since the last export, and uses a hard link in case the file hasn't been changed. This is done by comparing the media file in the Photos Library with the corresponding file in the Latest
folder. While a comparison by something like a MD5 or SHA checksum would be the preferred way to check if the file content has been changed, I've decided to implement a simple comparison based on the file size for performance reasons.
As you can see, the SnapshotPhotosExporter is highly optimized to always keep the export directory on the same file system. If you backup your disk with Time Machine, no extra disk space is required because of the hard links. If photos are modified within the Photos app (or Photos recalculates the photos e.g. because of changed algorithms), the photos in the export directory may also be changed. For using the photos with other devices or programs, this behavior will be what you need. For backups on external drives it wouldn't be sufficient - therefore the IncrementalPhotosExporter was designed.
Apple's photo management software for the Mac, Photos, has grown to be a fairly competent all-purpose storage locker. But as your photo and video library grows — and especially if you've taken advantage of iCloud Photo Library — you may find that your Photos library strains to fit on your Mac's hard drive.
While there are options to keep your Mac from running out of space, like optimizing your photo storage if you use iCloud Photo Library, it comes at a cost: Without a fully-stored Photos library, you won't be able to create secondary backups of your images and video. (And as good as iCloud has become, your photos and video are precious enough that they're worth keeping backed up in multiple places.)
There is an alternative: Moving your Photos library to an external drive (or creating an entirely separate library and syncing it with iCloud). Here's how to do it, and some reasons why you should — and shouldn't! — consider it for your needs.
Why you should (and shouldn't) use an external drive with Photos for Mac
There are a number of reasons why an external drive might make sense when you're working with Photos for Mac:
- You have a giant Photos library (and, if you use iCloud Photo Library, you want to ensure you have a secondary backup of everything in that library)
- You frequently swap computers and want to work on your images from any Mac
- Your library isn't huge, but you'd prefer to save space on your Mac for other files
- You share a computer with other users and you have limited drive space
- If you're working with space constraints on your primary computer, it's one of the easiest ways to back up your full iCloud Photo Library
That said, there are some downsides, too. Here are some reasons you might not want to use an external drive:
- You don't have a big enough library to warrant moving it off your Mac
- You don't want to have to worry about always having your external drive connected to view and edit your images
- You use a laptop frequently and can't afford an SSD, and you don't want to risk breaking your disc-based hard drive by constantly moving it
- You don't want to accidentally create duplicate libraries that can't be connected to iCloud Photo Library (because your offsite library is connected)
- Unless you purchase a speedy drive, working externally is almost always slower than working on your default hard drive
- You don't want to spend the money on an external drive
- If you use an automated backup service for your computer, you'll have to set up a second set of rules for backing up your hard drive
Best external drives for storing photos
Okay, so you've decided to move your Photos library over to an external drive. What next? If you already have an external drive, you can always use it for storing your Photos library (and save on cash). But if you're considering getting a new drive for this endeavor, here's what I suggest:
- Get a drive that's at least 1-2TB in space, preferably 4TB. With the iPhone able to save 4K video, our space needs aren't shrinking anytime soon: The bigger hard drive you can afford, the better.
- If you're buying a stationary hard drive, buying a disc-based hard drive is great, but buy good brands — don't try and save $50 on an off-brand hard drive. It's rarely worth the HDD failure.
- If you're buying a portable hard drive, consider SSD: It's very pricey in comparison to a disc-based drive, but if you know you'll be frequently moving around — especially if you plan to move around with the drive connected — you want a drive that can take a little rumble and tumble without skipping or failing.
- Hard drive speeds are important, too: The faster a drive's write speed, the quicker your images will copy; the faster a drive's read speed, the easier it will be for you to view images or video and edit them, too.
Want some recommendations for specific external hard drives? We've got those, too.
How to move your current Photos library to an external drive and use it as your primary library
As with creating a new library, moving your library to your external drive is a multi-step process. Here's how to go about it.
Step 1: Copy over your Photos library
- Connect an external drive to your Mac via USB, USB-C, or Thunderbolt.
- Open a new Finder window.
- Open your external drive in that window.
Open a new Finder window. Don't close your previous window (open to your external drive), as you'll need it shortly.
- Click the Go menu and navigate to your Home folder.
- Select the Pictures folder.
- Select your old library.
Drag it to your external drive in the other Finder window.
Your library will begin to copy over to your external drive. Depending on the size of your library and speed of your drive, this can take anywhere from a few minutes to several hours, so be patient. Don't unplug your drive or turn off your computer during this process.
Step 2 (if you use iCloud): Turn off iCloud sync on your old library
Before you open your copied Photos library on the external drive, you have to disassociate the library on your Mac from iCloud. (If you don't use iCloud Photo Library, you can skip these steps.)
- Open Photos on your Mac.
- Go to the Photos menu.
- Select Preferences.
- Click on the iCloud tab.
Uncheck iCloud Photo Library.
- Press Remove from Mac to remove any undownloaded low-resolution items from this library.
Quit Photos.
Step 3: Make your new library your system default
Mac Photo Library Export
Now, it's time to make your newly-copied Photos library your system default.
- Open Photos on your Mac.
- Go to the Photos menu.
- Select Preferences.
Click Use as System Photo Library.
Step 4 (if you use iCloud): Connect your new library to iCloud
Your external library is now set up to be your system default, but it's not currently connected to iCloud. If you use iCloud Photo Library and want to keep that connection active so that you can continually download items you've stored, read on. (Otherwise, you can skip this step.)
- Open Photos on your Mac.
- Go to the Photos menu.
- Select Preferences.
Click on the iCloud tab.
- Check iCloud Photo Library.
- Click Download Originals to this Mac.
- Wait for your Mac to download your images from iCloud. (Depending on the size of your iCloud library and your internet connection, this may take up to 24 hours; don't disconnect your external drive or turn off your Mac during this time.)
Once your library has fully synced and downloaded images, you can disconnect your drive; whenever you want to use your Photos library, you now need to connect your drive to your Mac.
Step 5: Get rid of your old library
A personal plea: Please, please, please make sure your library is fully copied and working on your external drive before you follow the steps below — once you've thrown away your original library, it's gone!
- Open a new Finder window.
- Click the Go menu and navigate to your Home folder.
- Select the Pictures folder.
Select your old library.
- Drag it to the Trash (or press Command-Delete on your keyboard).
- Empty the Trash.
- Open a new Finder window. Don't close your previous window (open to the Pictures folder), as you'll need it later.
- Select your external drive.
- Right-click (or control-click) on your copied Photos library on your external drive.
- Select Make Alias.
- Drag the alias to the Pictures folder.
Rename the alias to remove the 'alias' part of its name.
Now you have a direct link to your copied Photos library from the Pictures folder: This prevents your computer from accidentally creating multiple Photos libraries in case you forget to launch Photos with your external drive connected.
Note: If you're worried about accidentally creating libraries, you can always launch Photos by option-clicking on its icon in the Dock or Applications folder; this will give you the option of picking which library you'd like to launch.
How to create a new Photos library on your external drive and use it as your primary library
Creating a new library on your external drive is a multi-step process. Here's how to go about it.
Step 1 (if you use iCloud): Turn off iCloud sync on your old library
Before you create a new Photos library, you have to disassociate your current library as your system default. (If you don't use iCloud Photo Library, you can skip these steps.)
- Open Photos on your Mac.
- Go to the Photos menu.
- Select Preferences.
Click on the iCloud tab.
- Uncheck iCloud Photo Library.
- Press Remove from Mac to remove all low-resolution items from this library.
- Press Remove from Mac once more to confirm.
Quit Photos.

Step 2: Create your new Photos library
Once you've done this, it's time to create a new library.
- Connect an external drive to your Mac via USB, USB-C, or Thunderbolt.
- Option-click (and continue holding down option) when launching the Photos app on your Mac.
- When it asks you to choose a library, click on Create New….
Name your library.
- Press the Down arrow to expand the File picker and choose your external drive as the new location.
- Press OK to save it to your external drive.
Step 3: Make your new library your system default
You'll now have an empty library on your external drive. Next up: Making it your system library.
- Open Photos on your Mac.
- Go to the Photos menu.
- Select Preferences.
Click Use as System Photo Library.
Step 4 (if you use iCloud): Connect your new library to iCloud
Your external library has now been set up from scratch. If you use iCloud Photo Library and want to download all the items you've stored there to have an external backup, read on. (Otherwise, you can skip this step.)
- Open Photos on your Mac.
- Go to the Photos menu.
- Select Preferences.
Click on the iCloud tab.
- Check iCloud Photo Library.
- Click Download Originals to this Mac.
- Wait for your Mac to download your images from iCloud. (Depending on the size of your library and your internet connection, this may take up to 24 hours; don't disconnect your external drive or turn off your Mac during this time.)
Once your library has fully synced and downloaded images, you can disconnect your drive; whenever you want to use your Photos library, you now need to connect your drive to your Mac.
Step 5: Get rid of your old library
A personal plea: Please, please, please make sure your new library is live and working on your external drive before you follow the steps below — once you've thrown away your original library, it's gone!
- Open a new Finder window.
- Click the Go menu and navigate to your Home folder.
- Select the Pictures folder.
Select your old library.
- Drag it to the Trash (or press Command-Delete on your keyboard).
- Empty the Trash.
- Open a new Finder window. Don't close your previous window (open to the Pictures folder), as you'll need it later.
- Select your external drive.
- Right-click (or control-click) on your new Photos library.
Select Make Alias.
- Drag the alias to the Pictures folder.
- Rename the alias to remove the 'alias' part of its name.
Mac Photos Export Entire Library
Now you have a direct link to your Photos library from the Pictures folder: This prevents your computer from accidentally creating multiple Photos libraries in case you forget to launch Photos with your external drive connected.
Export From Photos App
Note: If you're worried about accidentally creating libraries, you can always launch Photos by option-clicking on its icon in the Dock or Applications folder; this will give you the option of picking which library you'd like to launch.
Questions?
Let us know in the comments.
Mac Photos Library Export Photos
Updated March 2019: Updated for macOS Mojave.
Serenity Caldwell contributed to an earlier version of this post.
iCloud Photo Library: The Ultimate Guide
Main
Backing up: The ultimate guide
Main
🍎 ❤️Mac Photos Library Export To Mac
Apple reminds us all that 'creativity goes on' in new YouTube video
Apple's latest YouTube video knows just how to tug at the heartstrings.