Migrating database and gallery to new server, problem with versions.dat file

vitalts

Joined: 2013-12-19
Posts: 5
Posted: Thu, 2013-12-19 21:50

I am an extreme beginner when it comes to gallery. I had gallery 2.2 installed on another server with a bunch of pictures in the g2data > albums folder. I am attempting to recreate this and install gallery onto a new server with the same pictures. I already got the mySQL databased copied over. I am able to install gallery up until the step where it creates the g2data folder. At this point I copy all the images to the albums folder in the new server. When i attempt to add the database, however, i get this error:

"Gallery tables already exist in this database! But there is no 'versions.dat' file in your G2 storage directory which we interpret as a broken state of G2. Either create a versions.dat file with the correct format if you think your G2 should still work or select a clean install, which will erase all data in the database and in the storage directory."

I do not want to delete the data in my database as it has all of the information from my old website. How can I get past this? I've tried taking the versions.dat file from my old server but that doesn't work. I've tried editing the file but that also doesn't work. Any help would be greatly appreciated.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2013-12-19 22:02

FAQ: How can I move my Gallery installation from one server to another?

Its very important when you copy over the entire g2data directory to make it readable/writable recursively for the server.
This can be done from the command line by: chmod -R 0777 /full/system/path/to/g2data

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
vitalts

Joined: 2013-12-19
Posts: 5
Posted: Tue, 2013-12-24 16:33

I tried that and now I'm getting another error. I tried running the install file again (index.php) and it says "File does not exist: sys_cpanel". It says the file is located in in gallery2/install. Any idea why this may be happening now?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2013-12-24 16:57

cpanel does not allow you to execute scripts that are writable.

my above instruction was to set g2data and all files contained within to 777 not to set gallery's core files to 777
from within your gallery directory(the one with config.php) execute:

find . -type f -print0 | xargs -0 chmod 0644
find . -type d -print0 | xargs -0 chmod 0755

then execute:chmod -R 0777 * from within your g2data

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
vitalts

Joined: 2013-12-19
Posts: 5
Posted: Tue, 2013-12-24 18:10

Thank you so much those commands did help it work. But now I'm stuck on a different error for the versions.dat. It now says this:

"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."

How can I get around this without doing a clean install?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2013-12-24 20:26

why would you run the installer? are you not migrating the same version of gallery?
did you try running the upgrader? yoursite.com/gallery2/upgrade/

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
vitalts

Joined: 2013-12-19
Posts: 5
Posted: Mon, 2013-12-30 17:02

I am migrating the same version of gallery. I just tried running the upgrader and it gave an error "Missing or invalid config.php". I'm looking at the contents of my gallery2 folder and there is a config.php file there. Any idea as to why I'm getting this error?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2013-12-30 17:41

make sure your config.php is readable by the webserver, and make sure all of the info contained within is correct.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
vitalts

Joined: 2013-12-19
Posts: 5
Posted: Mon, 2013-12-30 19:19

finally got it working. thank you so much!