So, you need to migrate from an old Symbiosis server to a new one? You’ve come to the right place! This guide will walk you through how to migrate your whole server, including databases, websites and mailboxes.
Before we begin…
Your old server can be any kind of server (ie, Legacy, Cloud, or Dedicated), as long as it’s running
Symbiosis 6 or above. If you’re not sure what operating system you’re running, just give us a shout.
In this guide we’ll call the old server
- Create a Cloud Server in just a few minutes! Pick
Symbiosis 8or later as your operating system. Note down the
adminpassword you’re given!
- The storage space on your new server should be the same or larger than your old server, otherwise you might not have enough space.
In this guide we’ll call the new server
Access to your servers
- You need access to your old and new servers using an SSH-client like PuTTY. The command-line can be scary, but this guide will walk you through every step.
- If you get stuck or aren’t sure about anything, just give us a shout.
Check web application compatibility
The versions of PHP and MySQL might be different on your new server. Ideally, check with your web developers whether or not your websites will be compatible with your new server before you continue.
Symbiosis 8 (Jessie): PHP 5.6 and MySQL 5.5 Symbiosis 7 (Wheezy): PHP 5.4 and MySQL 5.5 Symbiosis 6 (Squeeze): PHP 5.3 and MySQL 5.1
Let’s get started!
There are two phases to the migration process:
- Phase 1: Testing the waters. Your old server and websites remain as they are, but you can copy your sites to a new server and test whether they work. There’s no downtime really, so this phase is almost risk-free! You can back out at any point, delete your new server, and nobody will have noticed a thing.
- Phase 2: Making the switch. Here you change the DNS records for your websites to point to your new server’s IP address. You might have some downtime!
Phase 1: Testing the waters
This is the process of transferring your databases, sites and mailboxes from an old Symbiosis server to a new Symbiosis server. It’s essentially synchronizing your two servers so that they have the same data.
Export your databases
- Login to your old server as
adminuser using an SSH-client (eg, PuTTY). If using PuTTY, enter the Host Name (eg,
old.vm.bytemark.co.uk) and connect. When it prompts you for a user, type
admin, press Enter, and type your password.
- If you’ve forgotten your admin password, contact us and we can reset it for you with 5-10 minutes of downtime.
- Paste this command into your SSH-client and enter your
adminpassword again. This may cause a little bit of downtime, but probably not more than a few seconds (unless you’ve got a very large, complex database).
sudo mysqldump --defaults-file=/etc/mysql/debian.cnf --all-databases --add-drop-database --opt | gzip -9 > /srv/everything.sql.gz
You now have an export of your databases (including database users) at
/srv/everything.sql.gz. We’ll import this into the new server later.
Copy database maintenance file
We need to copy an important maintenance file. Run these two commands so that in the next section it will get transferred across to your new server:
sudo cp /etc/mysql/debian.cnf /srv/ sudo chown admin:admin /srv/debian.cnf
Now you can logout of your old server.
On Symbiosis, all of your sites and mailboxes are stored inside the
/srv directory. Let’s copy it all across. This will normally take a few minutes, but could take up to an hour or more if you have many gigabytes of data.
- Login to your new server as
adminuser using an SSH-client, similar to what you did above to login to your old server.
- Paste the following command, but replace
old.vm.bytemark.co.ukwith the name of your old server:
sudo rsync -av -e ssh firstname.lastname@example.org:/srv/ /srv/
You’ll be prompted for a few things:
[sudo] password for admin
- Type in the
adminpassword of your new server. You might not be asked for this.
- Type in the
Are you sure you want to continue connecting (yes/no)?
yesand press Enter.
- Type in the
adminpassword of your old server.
- Type in the
Import your databases
While you’re still logged into your new server, paste this command into your SSH-client and enter your
zcat /srv/everything.sql.gz | sudo mysql --defaults-file=/etc/mysql/debian.cnf
Now restart MySQL by running this command:
sudo service mysql restart
Install database maintenance file
Run these two commands:
sudo cp /srv/debian.cnf /etc/mysql/debian.cnf rm /srv/debian.cnf
If you’ve made any other changes to your old server that are outside of the
/srv directory, you need to manually make those changes on your new server too (assuming you want to keep those changes).
For example, if you’ve made changes to the Symbiosis firewall then you’ll probably want to make the same changes on your new server. And if you added any system cron jobs, don’t forget those!
The MySQL root password is usually important to have to hand. If you don’t know your MySQL root password, here’s how to reset it.
Test your websites
Follow these instructions to test your sites freely. Meanwhile, the rest of the internet still thinks your sites are hosted on your old server and service is unaffected.
Ready to make your new server live?
Once you’re happy that your sites are working on your new server, move on to Phase 2: Making the switch…
Phase 2: Making the switch
Do I need to resynchronize the two servers?
Your databases, websites and mailboxes are still hosted on your old server and may have changed by the time you get here. For example, mailboxes on your server may have received new emails, or your websites may have new or changed files.
Some of you may therefore want to resynchronize everything over to the new server just before going live. In many cases it doesn’t matter, for example if your sites and databases rarely have any changes. If you’re not sure, ask your web developers.
If you don’t need to resynchronize, just skip to Change DNS records at the bottom of this page. It’s much easier without resynchronizing, because both of your servers can host your sites while you change DNS records at your own leisure. You’ll have no downtime at all!
This part involves three steps, including some downtime.
Important: If your DNS records are hosted with us then you’ll need to ask us to transfer authority over to your new server. Before you carry on with this guide, email us with a couple of working days notice and we can perform the change at the time you require (Monday to Friday,
17:30 UK time).
Stop services on your old server
This will cause a period of downtime where your sites and mailboxes are inaccessible. The downtime lasts until you’ve made changes to your DNS records.
Login to your old server using an SSH-client. Paste and run these four commands, one at a time:
sudo touch /etc/symbiosis/monit.d/disabled sudo service apache2 stop sudo service dovecot stop sudo service exim4 stop
Repeat some steps from the testing phase
Warning: This will overwrite any database or website changes you’ve made on the new server. Don’t do these steps if you’ve made changes you want to keep!
Change DNS records
To point your domains at the IP address of your new server, you’ll need to make some DNS changes.
If you’re not sure whether the DNS for your domain is hosted with us, browse here and enter your domain (without the
www). If it lists our nameservers (eg,
a.ns.bytemark.co.uk) then the DNS is hosted with us.
- If the DNS for your domain isn’t hosted with us, go to the dashboard for your domain registrar (eg, Gandi.net or GoDaddy) and amend your DNS records there.
- If the DNS for your domain is hosted with us, we will need to transfer the DNS Authority to your new server for you.
Give it a few days and, once you’re happy, you can delete your old server. Get in touch and we’ll let you know how to retire it.