Migrating from Centova Cast v3
This page tells you how to move a Centova Cast v3 installation to Centova Cast v4 on the same server. The migration installs Centova Cast v4 beside Centova Cast v3 and imports the v3 data into it. Then it puts Centova Cast v4 in the place of Centova Cast v3.
The migration does not delete or move any data of Centova Cast v3 until you finalize it. Until then, you can roll the migration back and continue with Centova Cast v3.
How the Migration Works
The migration has four phases:
Installation.
install.sh --import-v3installs Centova Cast v4 in a temporary directory,/usr/local/centovacast4. The temporary installation uses its own web ports and its own service name,centovacast4. Centova Cast v3 continues to run.Import. The installer then starts the importer,
sbin/importv3. The importer copies the global settings, the email templates, the account templates, the staff accounts and the Single Sign-on hosts of Centova Cast v3. Then it imports the accounts, one at a time.Review. You examine the imported data in the control panel of the temporary installation. If you find a problem, you can roll the migration back.
Finalize. The importer stops Centova Cast v3 and moves it aside. It moves Centova Cast v4 to its final directory (normally
/usr/local/centovacast), and gives it the web ports of Centova Cast v3.
The importer records each change in a journal before it makes the change. If the import stops (for example because of a power failure), run the importer again. It continues from the point where it stopped. The journal is also the source for a rollback.
Requirements
Before you start, make sure that:
- Centova Cast v3 is release 3.2 or later. If it is older, upgrade Centova Cast v3 first.
- Centova Cast v3 is installed on the same server, and the file
/etc/centovacast.confnames its directory. - Centova Cast v3 is in operation, and you know the password of its
adminaccount. The importer uses the API of Centova Cast v3 to make a backup of each account. - The server uses systemd. The migration does not work with sysvinit.
- Your Centova Cast v4 license has a free seat for each client account that you import.
- The disk has sufficient free space. If both installations are on the same file system, the importer links the log files and the media files of each account into Centova Cast v4. Otherwise it copies them, and needs free space for the copies.
- The server meets the System Requirements of Centova Cast v4.
The installer and the importer make sure of these conditions before they change anything. If a condition is not
met, they show the reason, then stop. The message of the importer starts with preflight check failed and the name
of the check. In this case, Centova Cast v3 is not changed.
What Is Imported
Global settings
The server settings of Centova Cast v3, converted to the equivalent settings of Centova Cast v4.Email templates
The email templates of the administrator and of the resellers.Account templates
The templates for new accounts.Staff accounts
The staff accounts, with their passwords and their permissions. A v3 staff permission that has no v4 equivalent is not imported. Examples are the permissions for remote hosts, the command line and the API.Single Sign-on hosts
The remote servers of Centova Cast v3 become Single Sign-on hosts in Centova Cast v4. Centova Cast v4 can log in to Centova Cast v3 servers through Single Sign-on.Album data sources
The album data sources that Centova Cast v4 also has, with their settings.Reseller accounts and client accounts
The importer imports the resellers first, then the clients. For each account, Centova Cast v3 makes a backup, and Centova Cast v4 restores it. The backup has the configuration of the account, including its limits. A client account of a reseller stays with that reseller. If the reseller is not imported, the client account belongs to the administrator.Log files and media files
The importer transfers thevar/logandvar/spooldirectories of each client account. It links the files when it can, and copies them when it cannot. It does not change the files of Centova Cast v3.Hostnames
If an account uses a hostname that is not configured in Centova Cast v4, the importer adds the hostname to Centova Cast v4.
What Is Not Imported
- The
adminaccount. Centova Cast v4 has its own administrator account. The password of the v4adminaccount is the one from the installation. - Accounts on remote hosts. An account that runs on a remote server of Centova Cast v3 is not imported. Install Centova Cast v4 on that server and import the account there.
- Windows Media accounts. Centova Cast v4 does not support Windows Media. The import of such an account fails.
- Album data sources that Centova Cast v4 does not have, for example the
customandlastfmsources of Centova Cast v3. - Single Sign-on login tokens. These are temporary, and name no server.
After the import, the importer writes a report. The report lists each item that it did not import, or that it changed.
Streaming Software Conversions
Centova Cast v4 does not have all of the streaming software of Centova Cast v3. The importer converts each account to the software of Centova Cast v4:
- Shoutcast DNAS v1 becomes Shoutcast 2.
- ices becomes ices-cc. The two use the same configuration.
- sc_trans v1, sc_trans v2 and ezstream become Centova Source if it is installed, or else Liquidsoap.
- ices v2 becomes Liquidsoap if it is installed, or else Centova Source.
ices v2 streams use the Ogg Vorbis format. Centova Source cannot encode Ogg Vorbis. If Liquidsoap is not installed, Centova Source must encode the stream in a different format. The importer asks you to accept this conversion before it continues.
The streaming software for each account must be installed in Centova Cast v4 before the importer imports the
account. If it is not installed, the import of the account fails with a message, for example
Restoring this account requires the icecast streaming server, which is not installed. For the procedure, see
If the Streaming Software Is Not Installed.
Standard Mode and Minimized Downtime
The importer has two modes. You select the mode when you start the migration. You cannot change the mode later.
Standard mode
For each client account with a running stream, the importer stops the stream in Centova Cast v3. It then imports the account and starts the stream in Centova Cast v4. Each stream is off the air for the time of its own import. At the end of the import, all of the streams run in Centova Cast v4.In standard mode, the importer also disables the logins of Centova Cast v3. The login page of Centova Cast v3 shows
Maintenance in progress. The importer logs out all of the users of Centova Cast v3.Minimized downtime
Use the--minimize-downtimeoption. The streams continue to run in Centova Cast v3 during the import. The importer does not start any stream in Centova Cast v4. When you finalize the migration, the importer stops each v3 stream and starts it in Centova Cast v4 immediately.
If you import only some accounts (with the --accounts option of the importer), the logins of Centova Cast v3 stay
enabled. Changes that users make in Centova Cast v3 after the import do not reach Centova Cast v4.
Ports During the Migration
Until you finalize the migration, Centova Cast v3 keeps its web ports. The temporary installation uses other web
ports. By default, the installer uses the first pair of free ports, starting at 81 (HTTP) and 444 (HTTPS). If 81 or
444 is in use, it tries 82 and 445, and so on. To select the ports yourself, use the --import-ports option of the
installer. The temporary installation does not use ports 2197 and 2199 until you finalize.
For example, if the hostname is cast.example.com and the installer selects ports 81 and 444, the control panel of
the temporary installation is at https://cast.example.com:444/.
The streams keep their port numbers. If a port of an account is already in use in Centova Cast v4, the importer asks you to accept new ports for the account.
After you finalize, Centova Cast v4 uses ports 80 and 443, and ports 2197 and 2199. If you gave the --ports option
to the installer, those ports replace ports 80 and 443. If you installed with --no-webports, it uses ports 2197
and 2199 only.
The TLS Certificate During the Migration
During the installation, port 80 belongs to Centova Cast v3. For a Let's Encrypt certificate, the installer uses the web server of Centova Cast v3. It adds the Let's Encrypt check to that web server for a short time, then removes it.
If this is not possible, the installer uses a self-signed certificate and shows a message. After you finalize, get a certificate on the Hostnames page of Centova Cast v4. For more information, see the TLS Certificates section.
Procedure
Step 1: Install Centova Cast v4 Beside Centova Cast v3
Download the installer as described in the Installation section. Then run it with the
--import-v3 option:
./install.sh --hostname=cast.example.com --email=admin@example.com --import-v3
To keep the streams on the air during the import, add --minimize-downtime:
./install.sh --hostname=cast.example.com --email=admin@example.com --import-v3 --minimize-downtime
You can use the other installer options as for a new installation. The --base-path option and the --ports option
set the final directory and the final web ports, which apply when you finalize. For more information, see the
Installer Options section.
The installer installs Centova Cast v4 in /usr/local/centovacast4, and then starts the importer.
Step 2: Import the Data
The importer first asks for the password of the Centova Cast v3 admin account:
Version 3 administrator password:
Type the password and press Enter. The importer then makes its checks, imports the global settings, and imports the accounts. On a terminal, it shows the progress of each account.
If the import of an account fails, the importer shows the error and asks what to do:
Retry
Tries the import of the account again.Skip
Abandons the account and continues with the next account. The importer disables the partly imported account in Centova Cast v4, and starts the stream in Centova Cast v3 again if it stopped it.Abort
Stops the import and rolls back all of the changes. Centova Cast v3 is then in service again.
If a conflict occurs (new ports for an account, or a conversion to a different stream format), the importer asks if you accept it. If you do not accept it, the import of the account fails.
When the import is complete, the importer shows the location of its report, and this text:
Review your version 4 installation now. If anything is wrong, run `importv3 --rollback` to return to version 3. When satisfied, finalize with `importv3 --finalize`.
The importer then asks Finalize now, retiring version 3?. Answer no to review the import first.
If the Streaming Software Is Not Installed
The installer starts the importer immediately after the installation. At this time, no streaming software is installed in Centova Cast v4. The import of each account then fails with a message that names the missing streaming server or autoDJ.
To continue:
- Leave the importer open at its question.
- Open a second terminal on the server, as
root. Install each missing package in the temporary installation, for example:
~~~ {.bash} /usr/local/centovacast4/sbin/install icecast /usr/local/centovacast4/sbin/install liquidsoap ~~~
Go back to the importer and select
Retry.
For the list of packages, see the Streaming Software section.
<!-- QUESTION: install.sh --import-v3 starts the importer before any streaming package can be installed. The undocumented --packages option of install.sh installs packages before the import. Is the second-terminal procedure above the intended one, or should --packages get help text and be documented here? -->
Step 3: Review the Import
Log in to the control panel of the temporary installation (for example https://cast.example.com:444/) as admin,
with the password of Centova Cast v4. Examine the accounts, the settings and the streams. Read the import report in
/usr/local/centovacast4/var/lib/importv3/. Its name has the form report-DATE.txt.
If you find a problem, roll the migration back. See Rolling Back.
Step 4: Finalize the Migration
When the import is correct, finalize the migration:
/usr/local/centovacast4/sbin/importv3 --finalize
The importer makes its checks. It then shows the list of the changes and asks for your approval. If the directory
/usr/local/v3-centovacast already exists, the importer refuses to finalize. Finalize does these steps:
- It disables the cron jobs of Centova Cast v3, and stops the control panel of Centova Cast v3.
- It moves Centova Cast v3 from
/usr/local/centovacastto/usr/local/v3-centovacast. - It moves Centova Cast v4 from
/usr/local/centovacast4to its final directory. - It removes the init script of Centova Cast v3, and renames the service of Centova Cast v4 to
centovacast. - It gives Centova Cast v4 its final web ports.
- In minimized-downtime mode, it stops each v3 stream.
- It starts Centova Cast v4 and makes sure that it answers.
- In minimized-downtime mode, it transfers the latest log files and starts each stream that ran in Centova Cast v3.
- It removes the import files from the Centova Cast v3 directory, and deletes the backup files that the import made.
If a step fails, the importer undoes all of the steps and starts Centova Cast v3 again.
CAUTION: Do not finalize until you have examined the import. After a finalize is complete, you cannot roll the migration back.
Finalize does not delete Centova Cast v3. Its files stay in /usr/local/v3-centovacast. Finalize also does not
stop the database server of Centova Cast v3. When you no longer need Centova Cast v3, you can stop its database
server and delete its files yourself.
After the finalize, the commands of Centova Cast v4 are in its final directory, for example
/usr/local/centovacast/sbin/install.
Rolling Back
To undo the migration before you finalize it, type:
/usr/local/centovacast4/sbin/importv3 --rollback
The importer asks for the password of Centova Cast v3. It then does these steps for each imported account:
- It stops and disables the account in Centova Cast v4.
- It starts the stream in Centova Cast v3 again, if the import stopped it.
- It deletes the backup files that the import made.
It also makes the login page of Centova Cast v3 available again. If a finalize is in progress (for example after a failure), the importer undoes the finalize first.
A rollback continues after a failed step, and reports the failures at the end.
After a rollback, you can start a new import with:
/usr/local/centovacast4/sbin/importv3 --restart
The --restart option keeps the journal of the earlier import under a new name, and starts a new import.
Running the Importer Again
If the import stops before it is complete (for example because of a power failure or Ctrl+C), run the importer
again:
/usr/local/centovacast4/sbin/importv3
The importer reads its journal and continues the import. If you started the import with --minimize-downtime, give
this option again. The importer refuses to continue in a different mode.
The importer keeps its journal and its report in /usr/local/centovacast4/var/lib/importv3/. Do not delete this
directory before the migration is finalized. Without the journal, the importer cannot roll the migration back.
Importer Options
The installer starts the importer with the --v3-path option and, if given, the --minimize-downtime option. You
can run the importer yourself with these options:
--v3-path=PATH
Specifies the directory of Centova Cast v3. The default is the directory that/etc/centovacast.confnames.--v3-url=URL
Specifies the URL of the control panel of Centova Cast v3. The default ishttps://127.0.0.1:2199/.--insecure-tls
Accepts the self-signed certificate of the Centova Cast v3 control panel. This is the default for a URL on the server itself.--password-env=NAME
Reads the password of the Centova Cast v3adminaccount from the environment variableNAME, instead of asking for it.--accounts=USER,USER
Imports only the given Centova Cast v3 accounts. If a client account belongs to a reseller that is not in Centova Cast v4, the importer also imports the reseller.--on-error=POLICY
Specifies what the importer does when the import of an account fails. The options are:prompt
Asks you, with theRetry,SkipandAbortchoices. This is the default. It needs a terminal.skip
Abandons each failed account and continues.abort
Rolls the import back at the first failure.retry-once
Tries each failed account once more, then abandons it if it fails again.
--accept-conflicts
Accepts all conflicts without a question: new ports for an account, and conversions to a different stream format. Without a terminal, the importer refuses all conflicts unless you give this option.--backup-timeout=DURATION
Specifies the maximum time for the backup of one account in Centova Cast v3, for example45m. The default is30m.--minimize-downtime
Keeps the Centova Cast v3 streams on the air until you finalize.--dry-run
Makes the checks and shows what the import will do, but changes nothing.--no-tui
Writes plain text output, also on a terminal.--yes
Answers yes to every confirmation question.--restart
Keeps the journal of an earlier import under a new name, and starts a new import. The importer asks for your approval first. If the earlier import changed data, you must roll it back before you use this option. You cannot use this option after a finalize, or with--dry-run.--rollback
Rolls the migration back.--finalize
Finalizes the migration.--final-path=PATH
With--finalizeonly: specifies the final directory of Centova Cast v4. The default is the directory that you gave to the installer with--base-path, or/usr/local/centovacast.--final-ports=HTTP,HTTPS
With--finalizeonly: specifies the final HTTP and HTTPS ports of the control panel. Centova Cast v4 also uses ports 2197 and 2199. The default is the ports that you gave to the installer.--force-finalize
With--finalizeonly: finalizes also when the journal does not show a complete import.CAUTION: Do not use
--force-finalizeunless the import is complete. Finalize retires Centova Cast v3, and accounts that are not imported are then not in service.
You cannot use --rollback and --finalize together, or with the import options.
Example
A server runs Centova Cast v3 with 40 client accounts. Two of the accounts use sc_trans v2. The administrator wants the streams to stay on the air, and wants Centova Cast v4 on ports 80 and 443.
- The administrator runs
./install.sh --hostname=cast.example.com --email=admin@example.com --import-v3 --minimize-downtime. - The installer installs Centova Cast v4 in
/usr/local/centovacast4, with the control panel on ports 81 and 444, and starts the importer. - The administrator types the v3
adminpassword. The import of the first account fails, because no streaming software is installed. - In a second terminal, the administrator installs
icecast,shoutcast2,liquidsoapandcentovasrcwith/usr/local/centovacast4/sbin/install, then selectsRetry. - The importer imports the 40 accounts. The two sc_trans v2 accounts become Centova Source accounts. All of the streams continue to run in Centova Cast v3.
- The importer asks
Finalize now, retiring version 3?. The administrator answers no, then examines the accounts athttps://cast.example.com:444/. - The administrator runs
/usr/local/centovacast4/sbin/importv3 --finalize. The importer moves Centova Cast v4 to/usr/local/centovacast, stops each v3 stream, and starts it in Centova Cast v4. The control panel is now athttps://cast.example.com/.