My Practical guide of move G2 to another server: much easier and quicker than offical guide.

eaglelive

Joined: 2008-07-11
Posts: 55
Posted: Thu, 2009-04-16 17:19

My quick move meathod: (Risky if you change the g2 install path. and need install fold kept at your old server; So don't delete install folder after installation even the G2 suggested to do so; need a test temp DN)

1. Export database. (See details in below picture)
mysqldump --add-drop-table -h mysqlhostserver -u username -p database | bzip2 -c > g2.bak.sql.bz2
2. Tar cfz all folder of G2 installation.
3. Wget tar file at new server. tar xzf of tar file. Wget dumpsql, bunzip2 filename.sql.gz2
4. mysql - u newDBuser -p newDBname < backup.sql (Import database to new database)
5. change config.php of DB name, user, passworld, and g2data path; if setted main domain name, just remove the DN address(at the end section). chmod 777 gallery.
6. Test with Temp DN, if luck works. If not, run yourdomainname.com/upgrade/ (or run /install/ install it again, using your test domain name; upgrade is more easy and fast. )
7. login in to admin, set netpbm path. (If NetPBM not installed, install at first)
8. run mantance > rebuild/resize thumbnail.
9. check the new moved g2 is working fine? If yes, move your DN. finish.

I've moved about 10 G2 sites to new server. Those experience should be very practical compare to offical guide. And you need SSH.

 
tazhudin

Joined: 2009-03-03
Posts: 7
Posted: Tue, 2009-04-28 22:27

Can you write more detailed and more understandable?

 
GuWeHa
GuWeHa's picture

Joined: 2008-01-20
Posts: 28
Posted: Sat, 2009-10-10 14:48

Hi eaglelive,

many thanks for your posting - it saves me hours for setting up new Gallery2 installations ;-)

In general, performing your script above all things work fine. Today I moved two Galleries from BSD to Linux because of changing from webspace to my own server.

In addition to tazhudin I'd like a make few remarks/enhancements:

0. (good) knowledge of / experience with UNIX commands and mysql administration
is required to follow your instructions. Especially if somethings doesn't
work as described/expected!

1. before your 4. step can be performed you have to
- create newDBuser in your new database environment you like to use
- create newDBname in your new database environment you like to use
- grant newDBuser sufficient rights to newDBname
- don't forget to flush privileges!

If you didn't you won't be able to perform step 4.

2. as suggested in step 6. I choose the (re-)/install/ way which leads me to the required steps.
Do so I've been notice that I have to change the contents of the file login.txt in the Gallery home dir.
The related values to be set was given by the installer itself.

3. after performing all steps I did some additional things:
- check, if config.php is chmod(ed) to 644
- check, if g2data directory and all dirs/file in it are chmod(ed) to 777
- set all other dirs in the Gallery directory and belows to 755
- set all other files in the Gallery directory and belows to 644

In general, I agree with eaglelive that his way is one of the fastest to move a Gallery2 installation to another (v)server running UNIX too.

Greetinx

Guido

www.pix-bavaria.com & .de