If your Centova Cast installation is damaged beyond repair, the best approach is often to reinstall Centova Cast, then restore your old data. Please note that this is a particularly risky procedure; be sure to back up your data carefully in advance.
To perform a reinstallation and subsequent recovery:
1. Back up your Centova Cast database and account data
Note that this is not simply a precautionary procedure; you will need to restore this backup at the end of the recovery process, so do not skip this step.
If your server is otherwise intact, you can keep the backup on the same server on which Centova Cast is currently running. This is by far the fastest option. To do so, run:
mkdir -p /usr/local/castbackup/ mysqldump -uUSERNAME -p DATABASENAME > /usr/local/castbackup/centovacast.sql mv /usr/local/centovacast/var/vhosts /usr/local/castbackup
Replace USERNAME
with your MySQL database username and DATABASENAME
with your MySQL database name. Enter your MySQL database password when prompted. If successful, your complete backup will be stored in /usr/local/castbackup, and you can continue to step 2.
If you need to decommission or reimage the server that is hosting Centova Cast, you will need to copy your backup to a remote server.
If your Centova Cast installation is still intact enough to do so, you may be able to use the simplebackup script to push a backup to a remote server automatically. To try this, run:
/usr/local/centovacast/sbin/simplebackup --hostname=foo.example.com
If successful, this will login to foo.example.com as root
via SSH, and save
a complete Centova Cast backup in /root/centovacastbackup/ on foo.example.com
, and you can continue to step 2. Note that you can run /usr/local/centovacast/sbin/simplebackup --help
for help with custom backup options.
If the simplebackup utility is unusable, you will need to create a backup in /usr/local/castbackup
as described above, then copy /usr/local/castbackup
to another computer via other means (rsync, scp, etc.)
Note:
If you have lost either your Centova Cast database or your account data directory, then your installation has sustained permanent data loss and recovery will not be possible.
2. Uninstall Centova Cast
Note that this is, of course, only necessary if you do not intend to reimage the server or recover your Centova Cast installation to a different server.
If your Centova Cast installation is still intact enough to do so, you may be able to use the uninstall utility remove Centova Cast automatically. To try this, run:
/usr/local/centovacast/sbin/uninstall --i-want-to-delete-all-my-data
When prompted, enter the word UNINSTALL
to confirm that you do indeed want the uninstaller to remove Centova Cast and delete all of your data.
If the uninstall utility is unusable, you will need to remove Centova Cast manually. To do so, run
the following commands:
/etc/init.d/centovacast stop killall -9 sc_serv sc_trans icecast icecast2 ices ices2 rm -f /etc/cron.d/centovacast rm -rf /usr/local/centovacast rm -f /etc/centovacast.conf /etc/init.d/centovacast userdel centovacast groupdel centovacast userdel ccuser groupdel ccuser
Centova Cast should now be uninstalled and you're ready to install a new, fresh copy.
3. Install
Centova Cast as usual, as described in the installation manual. Ensure that you install it exactly as you did the first time (using the same server/source software and so-on) otherwise your streams will be unable to start after recovery.
4. Stop
Centova Cast:
/etc/init.d/centovacast stop
5. Temporarily disable
the Centova Cast cron jobs by moving /etc/cron.d/centovacast
to /tmp
:
mv /etc/cron.d/centovacast /tmp
6. Remove
all tables from the newly-installed Centova Cast database, and restore the backup you made of your Centova Cast database.
7. Restore
your backup
of the /usr/local/centovacast/var/vhosts/
directory.
8. Fix the file ownerships/permissions
on the recovered files:
/usr/local/centovacast/sbin/fixperms
9. Restore
the Centova Cast cron job
:
mv /tmp/centovacast /etc/cron.d
10. Start
Centova Cast:
/etc/init.d/centovacast start
Now, you should have a working Centova Cast.