Friday, September 29, 2006

Server Move

Last week I moved our VLE (Moodle) from a P4 Dell server to a brand new AMD64 server. Aside from a few gotchas and stupid mistakes (which I shall elaborate on) it all went pretty well. Quick too. Let me explain how I did it.

Firstly, I had to get the new server setup. This was easy using my Linux distro of choice, Ubuntu. All I had to do was stick the AMD64 server ISO in and choose a 'LAMP' install. This sets up Apache2, PHP5 and MySQL5 for me. The machine had this installed in under 20mins.

Next, I had to do a backup of the old server (just in case!) . I dumped all the databases required. The VLE, room booking system and help desk system (these other systems are internal only, the joys of virtual web hosting). Then I rsynced the web sites (/var/www/sitename/*) and the apache2 configuration (/etc/apache2/*) to our backup machine.

Next I had to transfer the data across to the new server. The database dumps were easy. I just scp'd them across. I also scp'd across the apache2 config and the website. I just had to tarball them beforehand. Once across, I just decompressed them in the correct place.

The databases needed a little more work. I installed PHPMyAdmin (I'm lazy) and re-setup the databases and their users. I then imported the data from the command line using 'mysql' (There's too much data to upload via PHPMyAdmin, more on that later).

At this point I turned the old server off and set the new server to use it's IP addresses (we use IP based virtual hosting, so there are several IP aliases set on the one nic). Everything came back up ok and the VLE worked. Time to go home!

No comments: