Restoring a package installation from backup
This topic describes how to manually restore a previous DataStax Enterprise (DSE) version from a package installation.
When restoring a previous version, it’s important that you don’t change the installation structure. If you must change the structure of the restored installation, you must make any necessary path and configuration adjustments.
To restore a previous DSE, do the following:
-
Stop the DSE service if it is running.
sudo service dse stop
-
Uninstall all DSE packages.
-
Debian and Ubuntu
sudo apt-get purge "dse-*"
-
RHEL and CentOS
sudo yum remove "dse-*"
-
-
Completely purge any existing data or configuration directories and files.
sudo rm -rf /etc/dse sudo rm -rf /var/lib/cassandra sudo rm -rf /var/log/cassandra sudo rm -rf /var/run/cassandra sudo rm -rf /usr/share/dse sudo rm -rf /var/log/spark sudo rm -rf /var/lib/spark sudo rm -rf /var/lib/dsefs
-
Reinstall the old version as described in the documentation for that release of DSE.
Do not start DSE after installation.
-
Extract your backup to the root of your drive.
sudo tar -xvf /backup_path/backup_archive_name.tar -C /
-
Move the snapshot files up two levels to their keyspace directories. Replace snapshot_name with the name of the snapshot created during the backup.
sudo find /var/lib/cassandra/data -mindepth 2 -path '*/snapshots/snapshot_name/*' -type f \ -exec bash -c 'dir={} && cd ${dir%/*} && mv {} ../..' \;
If you don’t know the snapshot name, you can find it by browsing the tar archive.
-
Restore permissions.
sudo chown dse_username:dse_group /var/lib/cassandra
-
Start DSE.
sudo service dse start
-
If you are using DSE Search, rebuild the index (5.1).