PDA

View Full Version : changing servers some help please


neil_r
12th of October 2006 (Thu), 06:16
I am about to change servers (I have finally given up with Lycos and have pinched some space on another server).

Can I simply replicate my base build from the old server onto the new one, back up my database on the old server and then restore that file on the new one ?

Any help, advice, tips would be gratefully received.

N

Pekka
12th of October 2006 (Thu), 07:54
What is MySQL version in old server and what it is in new server?

Basically you copy all files to new server with same folder structure, create a database for EE and restore old database there. If your database name, username and pass are same you do not need to edit any files, just check folder permissions.

If domain name is same paths work as they are.

Clear messages and purge uncookied data before backup in the old server.

neil_r
12th of October 2006 (Thu), 08:16
Thanks Pekka.

MySQL is ver 5.0 on the Old Server and 4.1.10 a-standard on the New. Will that be a problem

The Database, user and pass are different so what files do I need to edit?

The domain is different so I guess I have to change the "paths" once the restore is over.

Once again Pekka, thanks you for all your help.

Neil

DavidW
12th of October 2006 (Thu), 08:33
It should be a case of shifting the files, then loading a dump of the database tables into the new server. Exactly what you do depeneds on whether you have shell access to one, both or neither servers.


For the files, I'd use rsync over SSH, then fix any permissions that need fixing, but that's a big ask as I wouldn't think that many servers support rsync (mine does; I'm fortunate).

Any method will work - SFTP (preferable) or FTPing all the files will do. If you have an FTP tool that can copy from one FTP server to another, all the better - some of the more expensive commercial tools are supposed to be able to do this, including Vandyke SecureFX, which I use.

If neither of those options are viable, you may be able to retrieve a tar.gz, tar.Z or tar.bz2 of the whole directory structure from the old server via FTP if the FTP daemon has the necessary support installed. You'll need some way of unpacking it onto the new server, though.

If you have to, download the whole site to your computer, and upload it to the new one.


For the database, the 'classic' way to move an entire database is to use mysqldump. You can do this from the command line of one of the servers if you have shell access, or you could find a mysqldump binary for your computer and run it from there. Unless it's your own server, you'll probably have to create the database using some sort of control panel - make sure you pass the appropriate knobs to mysqldump so as not to attempt creation of the database if that's the case.

Alternatively, a file backup from EE Backup contains an SQL dump of the database can be used. The neatest method of feeding that through mysql or mysqldump to populate a fresh database escapes me at present, but there is a way to do it.

Either way, I'd purge all the uncookied data - and Pekka's suggestion to purge the messages is a good one as well.


This is something that I'll be in a better position to help with in a few days' time, as I'm working on setting up EE on my local FreeBSD server, so that I've got a setup where I can easily debug EE. Apache, PHP and MySQL are going in a jail - the intention is to configure the server for easy debugging of the PHP code, which I just can't do on my hosting provider's setup. I'm not intending to host EE publicly on my local server, because it's at my end of an ADSL line, but this will help me when working on the code.

I've got the jail created, and PHP and Apache installed. MySQL is compiling as I write this. When I've got PHP, Apache and MySQL configured, I need to choose, install and configure an FTP server. I installed ImageMagick and netpbm last night.


My intention is to write a shell script that rsyncs the files and updates most of the database tables from the hosting provider, leaving the configuration side of things on my local server intact. That way, I can run the script whenever I want to bring my test site into synchronisation with my live site. I've got some configuration of the setup to do, but I hope to be in a position to write the script later on today or tomorrow. If the coding isn't too kludgey, would the script be something that anyone else is interested in?

It's all good practice in FreeBSD administration, shell scripting, SQL, Apache / PHP configuration, and possibly a bit of perl or sed to patch up the configuration automagically (though most of what will need changing is in the database and is easiest handled with SQL commands).


Whatever you do, don't forget to change the configuration in EE for the new server - make sure you run through all the various setup steps and check things are OK. Things like .htaccess files may need changing, especially if the new server runs a different version of apache.

You'll need to change the MySQL details in basecode/SETUP_settings.php and in (management folder)/backup/ee_backup_prefs/preferences.php


Pekka can confirm this, but MySQL 4.1 shouldn't be a problem on the new server. If it's really running 4.1.10, ideally the administrator will upgrade it at some point (MySQL 4.1 is up to 4.1.21, and I think some of the fixes between 4.1.10 and 4.1.21 are security related). My live site runs on MySQL 4.1.18.

The file paths depend on the FTP setup on both servers - if it differs between the two, you will need to change them in EE.



David