Reputation: 14908
The Datastax documentation states
Cassandra can only restore data from a snapshot when the table schema exists. If you have not backed up the schema, [...]
What is required for a full backup of the schema? Simply backing up the system
keyspace?
Upvotes: 1
Views: 370
Reputation: 2379
There's no need to backup the system keyspaces, they will be recreated when DSE is installed on the new node. However, you'll need the schema for any user-defined keyspaces.
To backup the schema:
$ cqlsh -e "DESCRIBE SCHEMA;" > schema.out
To restore on a new node:
$ cqlsh < schema.out
Upvotes: 2
Reputation: 7365
In cqlsh (included with Cassandra), use the DESC SCHEMA
command.
DESCRIBE [FULL] SCHEMA
Output CQL commands that could be used to recreate the entire (non-system) schema.
Works as though "DESCRIBE KEYSPACE k" was invoked for each non-system keyspace
k. Use DESCRIBE FULL SCHEMA to include the system keyspaces.
Upvotes: 2