Restoring from a snapshot
Methods for restoring from a snapshot.
Restoring a keyspace from a snapshot requires all snapshot files for the table, and if using incremental backups, any incremental backup files created after the snapshot was taken.
Generally, before restoring a snapshot, you should truncate the table. If the backup occurs before the delete and you restore the backup after the delete without first truncating, you do not get back the original data (row). Until compaction, the tombstone is in a different SSTable than the original row, so restoring the SSTable containing the original row does not remove the tombstone and the data still appears to be deleted.
Cassandra can only restore data from a snapshot when the table schema exists. If you have not backed up the schema, you can do the either of the following:
- Method 1
- Restore the snapshot, as described below.
- Recreate the schema.
- Method 2
- Recreate the schema.
- Restore the snapshot, as described below.
- Run nodetool refresh.
Procedure
You can restore a snapshot in several ways:
Node restart method
Steps for restoring a snapshot. This method requires shutting down and starting nodes.
If restoring a single node, you must first shutdown the node. If restoring an entire cluster, you must shut down all nodes, restore the snapshot data, and then start all nodes again.
Package installations | /var/lib/cassandra/commitlog |
Tarball installations | install_location/data/commitlog |