May 15, 2009

Moving Picasa database from Window to Mac OS X

In the process of consolidating the digital presence of the family on a beefed-up MacBook, I have come to the point of moving the digital photo library. Moving the files almost did the trick, but to get my Picasa albums across, some hacking was required: We currently handle the library with Google Picasa which (apart from being very nice to work with) does things "the right way": It does not touch your original photo files, allowing you organize your them according to your desires, and it stores the metadata in the most accessible form possible:
  • Image edits does not affect original files: instead the edits are stored in picasa.ini files in the same folder as the file.
  • Keywords (tags) and captions are stored as IPTC comments directly in the photo files.
This means that if you just move your photos (with associated picasa.ini files) across from Windows to Mac, and fire up Picasa you are almost back to start with the only thing missing being information about albums (ordered collections of photos). The following is a recipe for getting that last piece across.

Outline:

  1. Move photo files to mac. Make sure to grab a copy of 


    1. <picasadir>/Picasa3Albums (as a zip file)
    2. <picasadir>/Contacts/contacts.xml


  2. Install and start Picasa, create an album and quit when scan has completed (skip face scan).
  3. Edit album (.pal) files to match new file location.
  4. Put .pal files as ~/Library/Application Support/Google/Picasa3/Picasa3Albums/<databaseid>/<albumid>.pal
  5. Replace <picasadir>/contacts/contacts.xml with old version
  6. Delete ~/Library/Application Support/Google/Picasa3/db3 to force database rebuild.
  7. Start Picasa and watch your albums and people appear :)

Detailed notes

The album information are stored in .pal files below your google folder:

google
+ Database ID
  + Album1 ID.pal
  + Album2 ID.pal
  + Album3 ID.pal
  + ....
where Database ID and Album ID are MD5 hash strings. The google folder is located as follows:
Vista
C:\Users\<username>\AppData\Local\Google
XP
C:\Documents and Settings\<username>\local application\Google
OS X
/Users/<username>/Application Support/Google/Picassa3/
You want to grab the whole folder Database ID and copy it to a zip on the mac (keep the original zipped because Picasa eats the pal files if it sees them when scanning). The .pal files are xml files. Search and replace over all of them to get the image paths right. I used two passes: first pass to convert \ to /, and second pass to correct the beginning of the paths.

Update

Just added step 5 to include the 'people' data as well. The image-specific data is stored in the picasa.ini file (again, Google is doing things the rights way), but this only links a given person to a unique number. To link that number to an actual person, you need to copy the file contacts.xml across as well.
blog comments powered by Disqus