Thursday, May 21, 2009

How can I move my gallery installation from one server to another?

 
 
 

How can I move my gallery installation from one server to another?

Here's a step by step guide:

  1. Backup your installation!
  2. Upgrade G2 on the old server to the same G2 version which you plan to install on the new server.
  3. Deactivate AND uninstall the url rewrite module if it is active because it will generate incorrect urls after your move.
  4. Backup G2 on your old host. Backup the database and the g2data folder.
  5. Copy the g2data folder and import the mysql database to your new host. You can skip copying the g2data/locks directory if you want.
  6. If you're using MySQL and moving from a windows based server to a *nix (unix, linux, ...) based server, you will have to change each database table name from lower case (e.g. g2_albumitem) to a case-sensitive name (in this example g2_AlbumItem). See script Image:CaseSensitiveTables.zip to automate this process a bit.
  7. Install the gallery2 code (extract gallery2.tar.gz/zip) on the new host. It should be the same G2 version as you last used on the old host (that's why you did the upgrade in step 2.).
  8. Have your webhosting partner change the owner of the g2data dir recursively (all files and folders) to the webserver user, unless php cgi + suexec is used. If you don't understand this instruction, forward it directly to your webhosting partner. The webhost has to do this only once, I'm sure they will do it. If they don't then make sure that the webserver user can write and delete files in this directory (chmod 777).
  9. Don't copy the config.php from the old host to the new host unless you're willing to hand edit it. It's easier to just run the installer; browse to newhost/gallery/install/. Make sure you choose "reuse existing database tables" in the database step. Point the installer in the appropriate step to the g2data folder (which is now not empty). And finish the installer. If you choose to copy the config.php instead of running the installer you have to manually change:
    • the g2data path
    • galleryId (at the bottom of config.php)
    • db name/user if needed
  10. Go to G2 Site Admin and change all paths if needed. imagemagick, zip, netpbm, ... all modules that depend on external programs have to be tested and reconfigured. Make also sure that the mail function of G2 works on the new host.

0 comments: