Restoring a package installation from backup

Restore a previous DSE version from a package install.

  1. Stop the DSE service if it is running.
    sudo service dse stop
  2. Uninstall all DataStax Enterprise packages.
    • Debian and Ubuntu
      sudo apt-get purge "dse-*"
    • RHEL and CentOS
      sudo yum remove "dse-*"
  3. 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
  4. Reinstall the old version as described in the documentation for that release of DataStax Enterprise.
    Important: Do not start DSE after installation.
  5. Extract your backup to the root of your drive.
    sudo tar -xvf /backup_path/backup_archive_name.tar -C /
  6. 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 {} ../..' \;
    Tip: If you cannot remember the snapshot name, you can find it by browsing the tar archive.
  7. Restore permissions.
    sudo chown dse_username:dse_group /var/lib/cassandra
  8. Start DSE.
    sudo service dse start
  9. If you are using DSE Search, rebuild the index (4.5, 4.8, 5.0, 5.1, 6.0, 6.7).