Reputation: 11
I am working on Cassandra DB for my environments, I want to take a backup of keyspaces but inside keyspaces, I have n number of tables so how to restore it? into a new server? like My keyspaces name is XYZ and inside keyspace, I have 100 tables , I am taking backups using nodetool snapshot but I want to restore into a new server, So how to restore keyspaces once into a new server?
Upvotes: 1
Views: 204
Reputation: 16323
The procedure for cloning data from one cluster to another depends on whether the source and destination clusters are identical in configuration. For the purposes of this post, identical configuration means:
If the clusters are identical then you can use the "refresh method" to clone the data which effectively means you can copy the snapshots from one of source nodes to the equivalent node in the destination cluster then run nodetool refresh
. You would repeat this process until the snapshots have been copied to all nodes.
For the detailed steps, follow the instructions I documented in How to clone Cassandra snapshots to an identical cluster.
If the clusters are NOT identical, you won't be able to use the refresh method because each of the partitions in the SSTables will be belong to different nodes in the destination cluster.
As such, you will need to follow the bulk load method which involves streaming the SSTables in the snapshots to the destination cluster using the sstableloader
tool. For the detailed steps, follow the instructions I documented in How to migrate data to a new Cassandra cluster. Cheers!
Upvotes: 1
Reputation: 57748
You should be able to copy the snapshot directories to a new server's data/
directory. Note that you'll first have to restore the system_schema
keyspace, as the table names and table IDs will need to match.
An approach with a higher chance of success would be to use the DSBulk tool. Run an unload from the source cluster, create the table on the new cluster with the same name, and then run a load operation to finish.
Upvotes: 1