Moving Your Gallery2 Installation From One Site To Another

How do we keep this site running? This post may contain affiliate links — the cost is the same to you, but we get a referral fee. Compensation does not affect rankings. Thanks!

The basic premise here is that you are migrating an existing gallery2 installation and you want to keep your albums, photos, descriptions, permissions, users, etc. in tact.

  • Turn off the gallery2 URL Rewrite module
  • Backup your g2data directory (to your hard drive).
  • Install gallery2 (import g2data) on the new site.
    • proceed through step 5 (database setup), then copy the following files from your old g2data directory (backup) to your new (and now empty) /g2data directory:
      • /g2data/albums
      • /g2data/sessions
      • /g2data/versions.dat
  • In the database step input the access information for the gallery2 db you just imported.
    • You should be able to select “reuse existing tables”
  • Under “admin user setup” you’ll be changing the install password, not the admin password (the admin password is restored from your backup)
  • When you get to the step prompting you to create the config file, the system may identify that your backup is an older version than your new installation. It should automatically take you to the “upgrader” (separate from the “installer”)
  • In the “Systems Check” step of the upgrader you’ll need SSH/ shell access to set permissions of your /g2data directory as follows:
    • chown -R webserverUser /home/beernet/g2data/ OR chmod -R 777

If you receive errors when trying to access your album via “edit”

It’s a common mistake for people to forget disabling their URL Rewrite module. Whether or not this is your case, log in to your standalone gallery2 installation (usually at /…/public_html/modules/gallery/gallery2), click on “modules” at left, and uninstall URL Rewrite. Re-install it, and configure it again. This should hopefully get things working again. Comment below if you’re still having troubles.

If photos upload without error messages but you don’t see them

There’s nothing more frustrating than having the photo upload finally succeed only to be greeted by a blank picture. Usually you can resolve this by browsing to:

admin > settings > acidfree

and selecting “Force all new images to be transferred by Drupal” under Filemanager Settings at the bottom of the page.

If that doesn’t work and you are getting the following error (or a similar one):

No such file or directory in .../core/classes/GalleryPlatform.class ...

then you may need to re-establish the user of your g2data directory as follows:

`chmod -R a+w /.../g2data`;
?>

Important – if you execute this code by creating a page within Drupal make sure to delete it when you’re done! Good luck! If you still can’t get it to work please post below.

Alex bring a series of in-depth articles on search marketing and content management systems as well as troubleshooting tips to We Rock Your Web's collection. He is an avid tennis player, nature enthusiast, and hiker, and enjoys spending time with his wife, friends, and dogs, Bella and Lily.

Leave a Reply

14 Comments on "Moving Your Gallery2 Installation From One Site To Another"

avatar
Anonymous
Anonymous

Just followed your directions and all went well. However, I used an existing backup of the database which has been created without first disabling the rewrite module. I followed your later step of uninstalling and reinstalling the module instead.

Great. Thanks.

Anonymous
Anonymous

Thank you *so* very much for this post. Tried (unsuccessfully) to migrate Gallery2 to a new server using the instructions on the Gallery2 site. The extra info you have here made this time a success. Thank you!

Anonymous
Anonymous

We have found a lot of new bugs and fixed a lot of bugs (including major things with “organize” and contextual menus), and created a bug category for documentation issues. The timeline shows most of the details.

Anonymous
Anonymous

I did not run across this How To until after I copied the files and uploaded them to the other server. What should I do at this point! Before I break things, thanks.

Anonymous
Anonymous

thanks! great article. hope many people will find it useful. used to find great blogs with useful pieces of information by search engine, but always search for something more. really glad to find good ones. and it really worked!

Anonymous
Anonymous

Thanks for this, it worked a treat!

Anonymous
Anonymous

Nice job on the layout Are you currently using Gallery2 on this website?

Anonymous
Anonymous

Hi,

This “How To” is very much appreciated as i have a Gallery2 installation which i need to migrate to a new host and the official documentation is very cryptic and of not much use!

I still have a doubt before i actually go through the process outlined here…is this process applicable to ANY default Gallery2 install or is it specific to Drupal integrated installs?

Thank you very much for your time and stay well!
Sendhil.

alexc
alexc

Hi Sendhil,

This was meant for Drupal installations, but may work in general.

Anonymous
Anonymous

Thanks for this, it worked a treat!

Anonymous
Anonymous

First, I want to thank you for posting this howto. By following it, I successfully did an install of Gallery 2.2.1 on a new server and transferred my existing gallery to it. I did encounter an error with the process as shown. In your step “Install Gallery2 on the new site.”, you need to include one more subdirectory to copy to g2data: /g2data/sessions.

Additonally, it would be helpful to state in the same section that this is where the old gallery database should be restored from the database dump.

Thanks again
Mark Osborne

Anonymous
Anonymous

In my existing installation, which I think was G1x upgraded to 2x, g2data is under the gallery directory, which is in document root.

In cPanel on my current host, I can’t make directories above document root, so please let me know if I need to make a special request…

Thanks,
K

wpDiscuz

Send this to a friend