Migrating a Centova Cast v3 installation to another server
How can I migrate my Centova Cast v3 installation to another server?
Migrating a Centova Cast v3 installation is a very advanced procedure which should only be performed by qualified systems administrators. Be sure to backup your data carefully in advance.
Note that this article is for migrating full Centova Cast installations only, including the web interface. If you are migrating a control (slave) server which is controlled by a separate web interface server, refer to this article instead.
DO NOT decommission your old server, or update DNS to point to your new server, until you have successfully performed the migration and verified that the streams are working on the new server.
To migrate a Centova Cast installation from Server A to Server B:
Update Srver A to the latest Centova Cast version.
Login to your client account at centova.com. Click
Manage Product Licenses, then click on your Centova Cast license. Then, click the
Re-issue licenselink. At this point, Server A will be left without a valid license, but will continue to work normally for several days.
Install Centova Cast on Server B per the installation manual.
Be sure to install it exactly as you did on Server A, including the same streaming server and autoDJ software and any configuration file modifications you may have made.
Note: In the particular case of Liquidsoap, it may not be possible to upgrade to the latest version on older systems. In this case, you will want to hold off the installation of Liquidsoap (on server B), until after you have completed the migration.
Stop Centova Cast on server A:
Stop Centova Cast on server B:
Backup your Centova Cast database on Server A. You can do this using the
mysqldumpcommand via SSH, or using a web-based tool such as phpMyAdmin.
mysqldump -uroot -p CAST_DB_NAME > cast_db_backup.sql
/usr/local/centovacast/var/vhosts/directory on Server A. By far the fastest and most efficient way to do this, is to use
rsyncto copy the entire directory and its contents directly to server B.
rsync -avze ssh /usr/local/centovacast/var/vhosts/ serverb.example.com:/usr/local/centovacast/var/vhosts
serverb.example.comwith the hostname or IP address of server B.
If rsync is not available for some reason, you can alternatively use FTP, NFS or any other method available that would allow you to copy the contents of
/usr/local/centovacast/var/vhosts/over to server B.
On Server B, restore the database backup you made in step 2. You can do this using the
mysqlcommand via SSH, or using a web-based tool such as phpMyAdmin.
cat cast_db_backup.sql | mysql -uroot -p CAST_DB_NAME
On server B, update your filesystem permissions and ownerships by running:
Start Centova Cast on server B:
If your IP address(es) on your new server are different from your old server's IP address(es), login to Centova Cast on server B and update each stream with the new IP address.
Also make any IP address or hostname changes that may be necessary under
Tip (advanced users only): IP address changes can be automated using shell scripting if desired. To change the IP addresses in the database, prior to step 8 (above) run:
cat cast_db_backup.sql | sed 's/oldip/newip/g' > cast_db_backup.sql.new
cast_db_backup.sql.newinto your new database on server B. You'll also need to change the IP addresses in all configuration files on disk. After step 7 (above), run:
find /usr/local/centovacast/var/vhosts -name '*.conf' -o -name 'settings.liq' | xargs sed -i -e 's/oldip/newip/g'
After restoring the database, and starting Centova Cast on server B, login to the web interface using the admin account, and restore the authentication key under Management > Hosts > Edit cluster server, to match the key in "/usr/local/centovacast/etc/rpcshadow" on server B.
To see the contents of rpcshadow via SSH, run:
At this point, you should have a working Centova Cast installation on Server B. Login to Server B and test your streams to make sure that they are working.