Gallery 2 Beta 2 Replication and Such

I have been using Gallery2 since beta 1 hit the Web. I had been investigating switching to Coppermine, since I preferred its layout over Gallery1, even though it lacked Gallery 1’s flexabilty and filesystem layout management features. Once I was pointed to Gallery2, however, I immediately stopped my Coppermine migration; for good.

I have been playing with G2 Beta 2 for a week now and it’s totally blown me away. It’s awesome. It’s greatly improved upon the user interface that shipped with G1 without compromising the unbelievable level of flexability G2 provides. I’ve imported all my G1 stuff and G2 is now my primary management tool for local photos of all themes.

Thanks guys, for your great work!

I have been using Gallery2 on my local network for a few weeks now with MySQL 4, however, I don’t have a static IP and my photos are huge. Still, I want to make them available to family, friends, and random people. I sought after a solution and came up with a bash shell script to replicate my local Gallery2 configuration to my hosting provider at my command.

For this to work, I first had to use rsync to ensure the code base for Gallery2 on my hosting provider matched my local copy. Next, I dumped my local database using mysqldump and transferred it over to my hosting provider, overriding the stale database there. Finally, I had to run through a series of ownership and permissions checks to ensure everything was accessible on the hosting provider via the Apache Web server.

I have variablized my creation such that it is useful for public consumption. Just ensure you configure the appropriate variables at the top of the script for maximum effect. You’ll also want to configure logins via ssh RSA public keys so you can run the script from a cronjob without having to enter your password each time. Finally, if you’re stuck with an older version of MySQL you will have download a copy of mysqlg2hack to save your item views, or they’ll be lost after the stale, remote database is overridden.

It is likely you will need to modify push_g2data.sh to a degree for it to work in your setup, but it ought to prove a useful base for making modifications.