9

I have a huge library in the new Photos app on my Mac OS X Yosemite machine, I want to know the easiest way to export or backup all these photos and videos on an external hard disk (formatted for Mac), giving that, I want to use the photos and videos on a Window 7 machine.

Note: the option File -> Export will take forever to export thousands of these items.

3
  • 2
    Depends whether you want the current edits of each picture or the master file. Current edits will require you to export. Masters can be dug out of the Library wholesale.
    – Tetsujin
    Jun 25, 2015 at 10:32
  • 2
    You'll want to have your disk formatted as ExFAT so that the Windows PC can read your drive. Jun 25, 2015 at 11:59
  • 1
    Or you'll need to use third party software on the PC to enable it to read a Mac disk.
    – nekomatic
    Feb 11, 2016 at 9:01

5 Answers 5

10

If you simply want the entire Masters structure copied to a new drive, then

  • first find your iPhoto or Photos Library file. Default location for both is ~/Pictures/

  • Right click the Library file & select Show Package Contents - that will expose the 'file' as the folder it really is.

  • The Masters folder should be just inside. You can copy that to anywhere.
    It is sorted into years, then months. Not all contained folders will actually be populated, if old photos were ever deleted, the file structure remains.

As pointed out in comments, if you need the copied structure to be readable natively on Windows, then you ought to format the target disk as ExFAT.
Windows cannot natively read Mac OS Extended disks & would need 3rd party support.

2
  • 1
    This provides essentially the bare minimum export functionality. You're going to lose all of your library organization and tags this way. Isn't there a better option? Nov 15, 2015 at 4:40
  • Not to export for anything other than Photos.
    – Tetsujin
    Nov 15, 2015 at 5:41
3

I know this is old and answered, but I think the script I put together after a day of googling and trying is worth sharing.

Modify your options, and this script either moves or copies your originals to a folder named 'yyyy-mm-dd Your Album Name'. So you keep track of your original album titles, and all photos are sorted by day as well.

Modify to suit your needs.. I do this to be able to have a shared file base of original photos synced by dropbox, and all sharing users can have their own copy of Photos.app use that as a base for referenced photos.

It attempts to avoid overwriting photos with the same name, by first verifying if a non-identical file exists at the same path already.

Also, it sets the timestamp of the newly made folders to the date of the events they have. Nice to sort events by date in finder or whatever, although the folder names already start with the date (because if you copy them elsewhere, timestamps may change anyway).

It is compatible with single quotes in album names. It may be compatible with quotation marks, but I have NOT tested that.

#!/bin/bash

#### A few options ####
#dryrun=1
dryrun=0

# Choose to duplicate (slow, space eating) or move (space saving, fast if on same drive).
#action=cp
action=mv

# set your paths
# origin:
libr="Photos Library.photoslibrary"
# destination:
destpath="MyProperlyOrganizedFotos"

# no idea why Apple chooses a funny date. Adjust to your time-zone needs
dateoffset=978307200
#### End of options ####


sqllib="${libr}"/Database/apdb/Library.apdb
s="sqlite3 ${sqllib}"
#${s} 'select fileName,imageDate,imagePath,projectUuid from RKMaster'

${s} 'select fileName,imageDate,imagePath,projectUuid from RKMaster' | sed 's,",thisisaquotationmark,g' | while read -r line; do
  echo $line
  name=`echo "$line" | awk 'BEGIN {FS="|"} {print $1}'`
  date=`echo "$line" | awk 'BEGIN {FS="|"} {print $2}'`
  path=`echo "$line" | awk 'BEGIN {FS="|"} {print $3}'`
  albumid=`echo "$line" | awk 'BEGIN {FS="|"} {print $4}'`
  albumname=`${s} "select name from RKFolder where uuid == '${albumid}'" | sed -e 's,/,:,g' -e 's,!,,g' -e 's,",thisisaquotationmark,g'`
  realdate=`date -r $(( ${dateoffset} + ${date} )) '+%Y-%m-%d' `
  touchdate=`date -r $(( ${dateoffset} + ${date} )) '+%Y%m%d1200' `

  # does this file still exist? or did we move it already?
  src=`echo ${libr}/Masters/${path} | sed 's/thisisaquotationmark/\\"/g'`
  if [ ! -f "${src}" ]; then
    continue
  fi

  # trim:
  newpath=`echo $realdate $albumname | sed 's/thisisaquotationmark/\\\\"/g'`
  if [ ! $dryrun -eq 1 ]; then
    expandednewpath=`echo ${newpath}`
    mkdir -p "${destpath}/${newpath}"
    touch -t ${touchdate} "${destpath}/${newpath}"
  fi
  target="${destpath}/${newpath}/${name}"
  index=0

  # add an integer index to a file if the name exists in this path already
  while [ -f "${target}" ] && ! cmp --silent "${target}" "${src}" ; do
    echo 'Avoiding overwrite: ' $index
    index=$(( $index + 1 ))
    target="${destpath}/${newpath}/${name} $index"
  done
  if [ $dryrun -eq 1 ]; then
    echo "Would do ${action} '${src}' '${target}' "
  else
    echo "${action} '${src}' '${target}' "
    ${action} "${src}" "${target}"
  fi
done
3

A few updates and additions:

  1. You won't find the Masters folder in Catalina and Big Sur. It is now called Originals.

  2. Copying the Masters or Originals folders isn't straightforward. Those folders contain a number of sub-folders and sub-sub-folders. And you'll export the original unedited versions of your photos i.e. you'll lose the edits.

  3. Photos to Disk has been demised. It was great until Mojave but broke on Catalina because of changes in Photos database structure. There's a new app in Mac App Store named Photos Takeout that works on High Sierra, Mojave, Catalina and Big Sur.

  4. Photos Takeout exports items stored locally (in the Photos Library on the Mac), externally (referenced files) or in the iCloud Photos Library.

0
1

Photos To Disk claims to do exactly this:

Using Photos To Disk you can retrieve your original photos and videos (including photos in RAW file format) from your Photo Library in just a few easy steps.

You can customize your folder structure to group your media files by year, month or day. For albums, Photos To Disk uses the folder structure defined in Photos.

Media files can be renamed after the titles that you have eventually defined in Photos. You can also prefix file names with media dates or media dates/hours.

Metadata (Title, Description, Location, Keywords, Adjusted Date and Time) can be embedded into JPEG, PNG, TIFF and PSD image files or stored in XMP sidecar files for other image file formats (e.g. RAW).

0
0

There is an excellent Apple Script from https://origin-discussions-us.apple.com/thread/7641108?start=0&tstart=0

set dest to "/Users/me/Desktop/export/" as POSIX file as text -- the destination folder (use a valid path)

tell application "Photos"
    with timeout of 180000 seconds
        repeat with i in albums
            set tFolder to dest & (get name of i)
            my makeFolder(tFolder) -- create a folder named (the name of this album) in dest
            export (get media items of i) to (tFolder as alias) without using originals
        end repeat
    end timeout
end tell

on makeFolder(tPath)
    do shell script "mkdir -p " & quoted form of POSIX path of tPath
end makeFolder
2
  • Please add more context than just a link as they often go stale. A quote from the site would suffice. Oct 9, 2016 at 13:12
  • 3
    Be aware that this only exports named albums. If a photo is not in a named album (and this does not include shared albums) it will not be exported. Oct 30, 2016 at 17:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .