I'm following the directions in the Codex for moving a Gallery2 install from one server to another. I don't know if it's because I already have folders in my g2data directory or what, but the permissions all seem to be in order.
This is Gallery2 1.0 / PHP 5.0.4 / Apache 1.3.3 / MySQL 4.1.3
I can mail my phpinfo file if anyone needs it.
Thanks.
Posts: 16504
Why do you have directories in g2data if you're going through the installer? Also double check that g2data is set to 777.
Posts: 35
Here are the directions I followed. In step 4 here, should I not have put the g2data folder back in the gallery2 directory before running the installer? It's unclear, since the gallery2 directory is the logical place to put g2data, as that's where it was on the previous install. Should I move my backed-up copy of g2data *out* of gallery2, finish the install, and then move it back in?
Q: How can I move my gallery installation from one server to another?
A: Here's a step by step guide:
0. Backup your installation!
1. Upgrade G2 on the old server to the same G2 version which you plan to install on the new server.
2. Deactivate the url rewrite module if it is active.
3. Backup G2 on your old host = backup the database and the g2data folder.
4. Copy the g2data folder and import the mysql database to your new host.
5. Install the gallery2 codebase (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 1.).
6. Have your webhosting partner change the owner of the g2data dir recursively 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.
7. I guess I wouldn't copy the config.php from the old host to the new host. Just run the installer, i.e. 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 (I'd really just run the installer, but if you insist...), you have to manually change:
- the g2data path, - galleryId (at the bottom of config.php), - db name/user if needed
8. 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.
Posts: 16504
Oh, you never said it was a restored g2data. It's probably a permissions problem as the user Apache runs as probably no longer owns those files so it can't change them.
If you have root access you can change the owner on all the file with chown -R (I don't know the rest of the syntax without looking it up) or change the permissions with chmod -R 777 g2data.
Posts: 35
So if this does manage to fix the problem, will the installer overwrite or damage any of the existing files in my g2data folder?
And thank you for your replies. I appreciate your help.
Posts: 16504
I haven't done many installs since new precautions have been added to the installer, but it looks like those instructions have been updated for them. If you backed up and restored BOTH your g2data and database from your other server, you should be fine.
Make sure that's not your only backup ;)
Posts: 32509
IMO the instructions are clear enough, you're just in a confused state
j/k
g2data can be anywhere on your webserver. it doesn't have to be in gallery2/ . we even recommend to not put it into gallery2 (read the instructions on the storage setup step page of the installer).
put the g2data first on the server, then start the installer. in the installer step "storage setup step", enter the path to the g2data dir. the path is in most cases different from the previous path, since it's a new server.
Posts: 35
This much is certain.
Yup, I know this. But I like it where it is, and where it has been.
The machine I'm doing the new install on is a clone of my previous machine, so everything is in the same place as it was before. I guess I could try putting the g2data directory in a different location, if that's going to get me over this hurdle. I'm not sure how putting my existing g2data directory in a different location on the new server is going to suddenly enable the installer to create the directory structure it needs, but I'll give it a shot.
Posts: 32509
in the instructions it says:
- copy g2data to your new server
- chmod -R / chown -R (-R is important) to fix the filesystem permissions of g2data
- then start the installer
it will not have to generate a new dir structure in g2data, because it's already there. you shouldn't get a warning or error since you fixed the filesystem permissions before
and again: you can put g2data anywhere you want.
anything else?
Posts: 35
Yes, now that you ask!
I made it through step four (was missing the -R; I thought I'd done that). Thank you. Now I'm at stage 8 and getting this error:
http://gallery.menalto.com/node/36399?highlight=Fatal%2Cerror%3A%2CMaximum
So, since I'm moving one G2 install (g2data and database) to a new server, does this mean I have to update the old server to the latest nightly snapshot, then backup my g2data and database, copy them over to the new server, and then do a clean install of the latest nightly snapshot on the new server? Is that the process you'd recommend?
Posts: 32509
in step 8 it should just have jumped to step 9, since you already have a working G2.
did you import the db tables etc?
did it offer the "reuse db tables" option in the database setup step after you hit save?
please read the instructions carefully. the first step says, upgrade.
you have two options:
a) upgrade on the old server, use the latest g2 version also on the new server
b) don't upgrade on the old server, use a backup of your old gallery2/ dir on the new server
Posts: 35
Yes. In fact I went back to the "old" server and made a new backup of the gallery2 database, then brought it to the new server and did a mysql < gallery2.sql command. Confirmed it in phpmyadmin.
Yep, it sure did.
I chose the first option. So now my old server is running the last stable full release of Gallery 2. After I'd upgraded it, I made a backup of g2data and gallery2 database on the old server and moved those files to the new server. After a couple hitches, I'm now stuck at step 8. Maybe I'll make new copies of g2data and gallery2 database on the old server and start from scratch again.
Posts: 32509
wait a second, can't you just go to your g2 (don't do step 8 and the rest of the installer steps)?
doesn't it work at this point?
Posts: 35
I haven't tried that. I was working on it over the lunch hour and just left it sitting at the step 8 error. I'll try just going to G2 as soon as I get home (2.5 hrs from now).
Thanks very much for your attention. I'm sure you all must be swamped right now.
Posts: 35
Nope. Didn't work. The main.php page loaded everything but the thumbnails. So I figured I just had to log in as admin and activate the module. So I logged in, which went fine, but when I tried to go to system admin, I got an error that gallery2/admin was not found. I'm thinking now that I may not have deactivated mod_rewrite before I backed up my g2data directory, which is what I'm going to do right now, and try again.