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.

4 comments:

RachelH said...

Thanks! That worked really well! I just want to clarify for any other readers (I was a little confused at first), what is meant by "Edit album (.pal) files to match new file location. Put .pal files as ~/Library/Application Support/Google/Picasa3/Picasa3Albums//.pal".

Copy across the old album .pal files from your old system and drop them into the albums folder on the Mac. Then it is these new album files you edit to point to where you have put your images on the mac.

Janus said...

Yes, re-reading the post I must admit that there are several unclear points. Glad it helped, though:)

Chad said...

This worked really well when my PC completely crashed and I was moving files off of the mounted drive to a Mac. With the advent of 3.5, there's a database of faces collected from the photos somewhere. I had gone through it a little bit before this crash, but I can see this being a lot more work a couple of years from now. Do you know how the face database is stored and if it can be transferred? It doesn't appear to be in the picasa.ini files.

Janus said...

@Chad: Hadn't played with faces till last night: seems that the face rectangles are in picasa.ini, but that you need to get contacts.xml across to get the faces linked to a name.

I just tried deleting everything but contacts.xml and Picasa3Albums, and that seemed to work fine.