Added by Travis Wu, last edited by Travis Wu on Aug 08, 2008  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

First thing first: the Demo

My Story

I've been using Gallery since 2000 and finally I think it is time to move away from it.
Gallery is a fantastic piece of application, but it has become too heavy and too slow. I was hosting about 6000 pics on my site, with 1.x, it was a drag, whatever I click I had to wait for 5 seconds. Eventually I had to write my own caching code to deal with the situation. 2.0 solved the issues but it wasn't as spiffy as most of the newer gallery apps out there. Plus most of the time, I barely use 30% of the features it has to offer.

Just 2 weeks ago, I found ZenPhoto and trying to convenience myself not to do the switch.

What Migrator?

ZenPhoto is great, it's lean, Ajax-y and it gets the professional look and feel. Since it is folder file structure based system, I thought the migration could be as easy as moving the album folders.
Well, While moving everything under g2data/albums/ to zenphoto/albums/ does move all the pictures, I lost most of the album/photo titles, descriptions, timestamps and comments. Being a young product, the user base/support isn't strong. Finally I had no choice but writing this tool to help me with the migration process. (This tool was inspired by this post at ZP)

Features:

  • migrate albums: titles and description
  • migrate photos: titles only (since I don't have descriptions for photos in Gallery2)
  • migrate media files: titles only
  • migrate timestamps
  • migrate comments
  • takes care of multiple images with the same name
  • progress bar
  • logging

Todo (shortly)

  • migrate timestamps
  • migrate comments
  • convert video files (to flv) on the fly: I also have a script to convert video files to flash files, maybe I'll add it so media files are converted.

Quick Howto

  1. Install ZenPhoto and have your Gallery2 database ready on the same host
  2. Copy your Gallery2 data to ZenPhoto, e.g:
    cp -Rp /var/www/g2data/albums/* /var/www/zenphoto/albums/
  3. Populate the ZenPhoto database by browsing to your zenphoto with your browser and pre-cache all your photos. (so the metadata are populated in ZenPhoto database)
  4. Download the tool, extract it somewhere under your webroot then make it writable Apache server
    e.g:
    cd /var/www/htdocs/
    tar -zxvf g2z.tar.gz
    chown -R www-data:www-data g2z
  5. Browse to the g2z location e.g: http://www.xxxx.com/g2z/ with your browser and fill in the required information; no logfile will be generated if log file field is empty.
  6. Click on "Migrate Now" button and wait.
    Always backup before performing.

Download

Here is my first version. g2z.tar.gz
Code clean up is needed. comments needed.

Does this already include image description migration? Based on the SQL query at http://www.zenphoto.org/support/topic.php?id=3259it should be possible I guess?

Thanks for this nice piece of software!

Posted by Anonymous at Sep 04, 2008 10:02 | Reply To This

yes. It can be done. I just haven't got time to do it yet and I'll be traveling for the next 4 months. we'll see

Awesome tool!  Thanks so much for creating this user, this should be published on ZenPhoto website since I couldn't find a darn thing about transferring my old database to the new zenphoto database. 

 However I was confused on the step that says "under your webroot then make it writable Apache server."  I had to skip that one since I couldn't find anything about it on google nor I'm a much literate when it comes to those kinds of things.  I only know how to deal with html and some php.  

Anyways, thanks for your help!

Posted by Anonymous at Nov 13, 2008 13:31 | Reply To This

Basically you need to do a chown. e.g:
the folder is: /var/www/zenphoto/albums
and your apache run as the user: www-data
then you need to do :
chown -R www-data:www-data /var/www/zenphoto/albums

Sounds like a great script! Will test it out tonight and see if it works. Agree with your observations on Gallery2.

Jonathan

Posted by Anonymous at Jan 06, 2009 11:50 | Reply To This

Looks great.

Any chance of being able to specify different accounts and servers for each DB?

Posted by Anonymous at Jan 15, 2009 05:25 | Reply To This