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:

  1. Update Srver A to the latest Centova Cast version.

    For example:

  2. Login to your client account at centova.com. Click Manage Product Licenses, then click on your Centova Cast license. Then, click the Re-issue license link. At this point, Server A will be left without a valid license, but will continue to work normally for several days.

  3. 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.

  4. Stop Centova Cast on server A:

    /etc/init.d/centovacast stop
  5. Stop Centova Cast on server B:

    /etc/init.d/centovacast stop
  6. Backup your Centova Cast database on Server A. You can do this using the mysqldump command via SSH, or using a web-based tool such as phpMyAdmin.

    For example:

    mysqldump -uroot -p CAST_DB_NAME > cast_db_backup.sql
  7. Backup the /usr/local/centovacast/var/vhosts/ directory on Server A. By far the fastest and most efficient way to do this is to use rsync to send it directly to server B. For example:

    rsync -avze ssh /usr/local/centovacast/var/vhosts/ serverb.example.com:/usr/local/centovacast/var/vhosts/

    Replace serverb.example.com with the hostname or IP address of server B.

    If rsync is not available for some reason, you can alternately create a tarball of the vhosts/ directory on server A, manually copy it to server B, and extract it on server B.

    For example, on server A:

    cd /usr/local/centovacast/var/vhosts
    tar czvf /cast_backup.tar.gz *

    Then copy the tarball to server B, and run:

    cd /usr/local/centovacast/var/vhosts
    tar xzvf /cast_backup.tar.gz
  8. On Server B, restore the database backup you made in step 2. You can do this using the mysql command via SSH, or using a web-based tool such as phpMyAdmin.

    For example:

    cat cast_db_backup.sql | mysql -uroot -p CAST_DB_NAME
  9. On server B, update your filesystem permissions and ownerships by running:

  10. Start Centova Cast on server B:

    /etc/init.d/centovacast start
  11. 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 Management->Hosts.

    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

    Then import cast_db_backup.sql.new into 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'

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.

NOTE: This article is for Centova Cast v3 only; an alternate version exists for Centova Cast v2.