Migration from Gallery 2.2 on old server to Gallery 2.n on new server

user4353

Joined: 2009-11-25
Posts: 6
Posted: Thu, 2009-11-26 10:13

I have been looking through all the available documentation that I can find, but none seems to address the specific issue of migrating from an old server to a new one. If there is something I have overlooked, I would of course appreciate a referral.

My situation is this:
I currently have a running Gallery2, version 2.2, on a FreeBSD6 server. This needs to be migrated to a server running CentOS5.4 (a Linux flavor). The version should of course also be brought up to the latest stable, which I believe is Gallery 2.5?

Ideally, it would be great if I could simply install Gallery2 from the CentOS native rpm's and simply migrate the data. And it may indeed be just that simple.

However, not knowing the inner workings of Gallery, I am hesitant to try anything without a bit of senior input. Which is why I am posting here.

For instance, would it be a good idea to first upgrade the old install to 2.5 and then migrate? Or would that be a wate of time and simply an additional potential for problems?

Is there a way to export all the data from 2.2 and then simply import it into the new install? That would be cleanest and best, I am sure, but I am have searched in vain for such a feature.

Barring that, is there description somewhere of what steps would be required to make sure I get all the necessary meta-data, as well as image data, pulled from the old install?

In general, I would very much appreciate any advice on how to best approach this migration.

Thanks!

/Niels

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-11-26 14:41

First upgrade on the new server. Read this:
FAQ: How can I move my gallery installation from one server to another?

And the current version is 2.3. Download it from here:
http://gallery.menalto.com/downloads
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-11-26 15:43

As Nivekiam says, you must upgrade first. There is no mechanism to export the data from one version and import the data to another version. The 'export' is simply a dump of the SQL database, and the 'import' write the new SQL database. The codebase that runs on the imported data must therefore be the same as runs on the old data.

G2.3 (the latest version) has a mechanism to export the data from inside G2 as a backup file, but that won't help you with a previous version.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-11-26 16:08
Quote:
G2.3 (the latest version) has a mechanism to export the data from inside G2 as a backup file, but that won't help you with a previous version.

I don't know about you, but I've never been able to get that to restore properly. Others have complained about that too. I wouldn't ever trust a backup that any web software, including Gallery, spit out for me, do a database dump and backup your file system and keep that :)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-11-26 16:48
Quote:
I don't know about you, but I've never been able to get that to restore properly.

I confess, I've never tried. I agree that you can't be a database dump!

I suppose it would be feasible to migrate to a new installation of 2.2, and upgrade that in place, I can't see why you'd absolutely *have* to upgrade the original first. And that way if the upgrade fouled up (sometimes happens :whistle:) then you've still got an untouched copy.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-11-26 17:16
Quote:
I suppose it would be feasible to migrate to a new installation of 2.2, and upgrade that in place, I can't see why you'd absolutely *have* to upgrade the original first.

Same here. I've done that and upgraded when I got to the new server. I think that is in the instructions for those people who don't migrate their current code base and instead grab the current code from gallery.menalto.com (seems there is a fair number of people who do that). When I move my sites around, I move the entire thing. But then again I use ssh and tar and can just wget from the old server and unpack on the new server :). I think a lot of people are trying to save in downloading the 10,000 of files G2 has because they are on cheap hosts who either don't have a decent backup solution that works well or they only know of FTP.

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-11-26 17:55

Do you think there's an argument for making more obvious the links for people who want to download old versions, for that purpose?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-11-26 18:10

Right now the links to the old versions are broken. Some update on SourceForge seems to have gotten rid of all older versions of G1, G2 and G3.

Only 2.3 and 2.2.6 exist for G2.

Right now I have on my site some downloads for older versions. I don't know if I'll keep them there permanently, but for now it hasn't even started to scratch my bandwidth allocation.

These are all checked out of SVN and I'm pretty sure they are the last release of that branch:
www.kevinnehls.com/temp/gallery2.2.zip (most likely 2.2.6) (so really someone could get that from SF...)
www.kevinnehls.com/temp/gallery2.1.zip (most likely 2.1.2)

I don't have the incremental versions, 2.2.5, 2.2.4, etc because I don't know SVN well enough to figure out how to check those out :)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
user4353

Joined: 2009-11-25
Posts: 6
Posted: Thu, 2009-12-03 12:53

Thank you for your assistance so far. Unfortunately, I am not having any luck with the migration.

I upgraded Gallery2 to the latest 2.3 release on the FreeBSD server (downloaded today, 2.3 "typical" install), which seems to have worked. At least I can use and browse the gallery as normal.

However, it appears that version is not compatiable with the one available in the central CentOS repository, although they are both described as Gallery2.3. Specifically, the version information from CentOS is:
Version : 2.3
Release : 15.el5

When running the installer after moving and chown'ing the data and importing the database, I get the following error:

"Gallery tables already exist in the database and there is a versions.dat file in the Gallery storage directory. But the version of the installed Gallery database tables does not match the version of the installed data in the Gallery storage directory. Select a clean install to erase all data in the database and in the storage directory and to advance to the next step."

As you can see, it doesn't actually give me a hint as to what the incompatible versions are. Perhaps my only option is to remove the rpm-based installation from the CentOS machine and do a manual install?

 
user4353

Joined: 2009-11-25
Posts: 6
Posted: Thu, 2009-12-03 12:55

Aaaaactually, I just realise that I may have imported the wrong database-backup. Ahem. I'll get back to you.

 
user4353

Joined: 2009-11-25
Posts: 6
Posted: Thu, 2009-12-03 14:01

Well, that helped a little bit. But ufortunately, not enough.

I've managed to install Gallery2 using the old data files and the old database. It is working as far as the structure goes -- in other words, all the albums show up on the front page. However, there's two major issues:

- All images and thumbnails are broken, ie. they all display the default broken image icon. It is possible to browse the albums as if nothing was wrong, but no pictures work at all.
- Login fails. Regardless of logging in as a user or as admin, or even as an invalid user, all attempts to login fail with the error message "An error has occurred." and nothing else.

I have changed the file permissions on the g2data directory to "apache", which is the user the httpd process is running as. I have also looked in the httpd log files and nothing is being logged as far as problems go. The access_log does, however, log a unspecified 500 error:

nnn [03/Dec/2009:14:57:26 +0100] "POST /gallery2/main.php HTTP/1.1" 500 844 "<referrer>" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5"

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-12-03 14:30
Quote:
However, it appears that version is not compatiable with the one available in the central CentOS repository,

I'd recommend against ever installing Gallery from a distro's repository. They seem to be broken quite frequently. Grab Gallery from http://gallery.menalto.com and you'll be good.

Be sure to follow these instructions when moving servers:
FAQ: How can I move my gallery installation from one server to another?

Server errors aren't logged in the access log, check the error log.

You can also try putting Gallery into debug mode:
FAQ: How to set/use Gallery in debug mode?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
user4353

Joined: 2009-11-25
Posts: 6
Posted: Thu, 2009-12-03 14:40

Thank you. I failed to mention it, but I have actually already overwritten the distro's installation with the one from the menalto tarball.

I may have been unclear, but I did check the httpd error_log, which as empty (since the last realod, that is).

Putting Gallery into debug mode gives the following information:

Quote:
Error (ERROR_BAD_PATH) : Invalid path: modules/captcha/classes/CaptchaValidationPlugin.inc

* in modules/core/classes/helpers/GalleryFactoryHelper_simple.class at line 171 (GalleryCoreApi::error)
* in modules/core/classes/helpers/GalleryFactoryHelper_simple.class at line 201 (GalleryFactoryHelper_simple::newInstance)
* in modules/core/classes/GalleryCoreApi.class at line 175 (GalleryFactoryHelper_simple::newInstanceById)
* in modules/core/UserLogin.inc at line 115 (GalleryCoreApi::newFactoryInstanceById)
* in main.php at line 250 (UserLoginController::handleRequest)
* in main.php at line 104
* in main.php at line 88

I suspect this means that I had a module enabled in the old installation that is no longer functional. I'm going to try going back to the old install and upgrade and disable as many plugins as I can, then try again.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-12-03 14:45

Yeah, depending on which tarball you grabbed, the captcha plugin may not have been in there.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
user4353

Joined: 2009-11-25
Posts: 6
Posted: Thu, 2009-12-03 16:17

Thank you very much for your help. I have now managed to get the installation working on the new server.

It took some more installations back and fourth, as well as deinstalling all of the plugins that (for some reason) gave version warnings in the installer. I also had a problem with php running out of script memory, the default installation only allowed 16M (and so the plugins page wouldn't load). I increased that to 256M, which worked.