Migrating from Symbiosis
This rough guide will take you through migrating from a server running Symbiosis, to a new server running Sympl.
It requires a little downtime of any sites running on the old server, but you have the option do a dry-run and check things work before committing to the change.
Note that while it's not needed for the dry-run, you will need access to change your DNS records to make the change.
Note that this guide assumes that You;re running the most recent version of Symbiosis, but due to various changes in Symbiosis over its lifetime and a lack of updates for it, this guide can not be fully tested, so you should ensure you do the dry run before the live run. Where possible, servers should first be upgraded from Symbiosis to Sympl, which then makes migration much easier.
Preparation
If on your source server you are running CMS packages such as Joomla or Wordpress etc, it may be a good idea to clear their cache. In many cases the cache can double the file size of the site so clearing this cache can reduce not only processing time but the amount of data that needs to be copied to the new location.
Dry Run
On The Source Server Running Symbiosis
Dump the Databases
sudo /etc/symbiosis/backup.d/pre-backup.d/10-dump-mysql
Copy Databases and Sites To New Server
Copy the databases to the sympl
users home on the new server:
rsync -aviP /var/backups/mysql/* sympl@new-server.example.com:~/incoming-db
Copy data to the new server, overwriting any changes:
rsync -aviP /srv/*.* sympl@new-server.example.com:/srv/
On The Destination Server Running Sympl
Switch back to the server running Sympl, logged in as the sympl user.
cd ~/incoming-db ; ls -la
This directory contains database backups, named asfter each database.
For the next section, skip any files with the names mysql
, roundcube
, information_schema
or performance_schema
, as these are system databases.
For each file, create the new databases on the new server with sympl create database databasename
. You will be given a new password for that database, which will also be saved to a file in the sympl
users home directory.
For each of the sites, you will then need to update the MySQL username and password to match these new standardised credentials. These will be found in configuration files. The parts you'll likely need to change are:
Username: databasename Password: passsord_as_provided Database: databasename Host: localhost
You should then be able to import the databases, one at a time with zcat databasename.sql.gz | mysql -u 'sympl' databasename
Once this is all complete, run sudo mysql_upgrade
to ensure any database updates have happened.
Then run: sudo sympl-filesystem-security; sudo sympl-web-configure
Testing the sites
For each site, you'll probably want to test things, which you can do by editing your hosts file and then browsing to the sites manually.
If you're running Sympl 12 or newer, and you have PHP incompatibility issues, you can use the selectable PHP options to easily change the version of PHP the site runs on.
Once you're happy everything is working, then you can do the live run then undo the hosts file edits.
Live Run
You will need to update the DNS for the relevant domains when making this change, so before starting this ensure you have access to change the DNS all the domains being moved.
On The Source Server Running Symbiosis
Stop the services to prevent anything changing while you're migrating things over.
You can skip this step if you're not moving all the sites at once, or aren't worried about changes not being copied over while DNS propagates.
touch /etc/symbiosis/monit.d/disable
sudo service apache2 stop
sudo service exim4 stop
sudo service dovecot stop
If you need to re-enable these services later, you can do so with rm /etc/symbiosis/monit.d/disable
Dump the Databases
sudo /etc/symbiosis/backup.d/pre-backup.d/10-dump-mysql
Sync Sites And Databases To New Server
rsync -aviP /var/backups/mysql/* sympl@new-server.example.com:~/incoming-db
This will sync the sites over again with any changes. Note that if you updated database details in the dry-run, you will need to redo the changes, but if you are confident nothing has changed since the dry-run, you can skip this step.
rsync -aviP /srv/*.* sympl@new-server.example.com:/srv/
On The Destination Server Running Sympl
cd /home/sympl/incoming-db
You can now re-import the databases with any changes.
As befores, skip the files mysql.sql.gz
, roundcube.sql.gz
, information_schema.sql.gz
and performance_schema.sql.gz
.
For every database file in the directory (excluding the ones above), run zcat databasename.sql.gz | mysql -u 'sympl' databasename
.
If you did the rsync of /srv
earlier, you will need to update the database credentials again for each site using these databases.
Once this is all complete, run sudo mysql_upgrade
to ensure any database updates have happened again.
Then run: sudo sympl-filesystem-security; sudo sympl-web-configure
to trigger the configuration.
Test The Sites
As before, edit your hosts file so you're looking at the new server, and make sure the sites work, making any fixes as needed.
Once you're happy the sites are working on the new server, undo the hosts file changes.
Move the DNS to Point To The New Server
You should now make the DNS change if you haven't done so already, so the sites are publicly swapped over.
In DNS, any A
records with the address of the old server should be updated to the address provided when running sympl-ip
, and any AAAA
records should be updated to the IPv6 address provided when running sympl-ip -6
. CNAME
and other records should be updated as needed.