Search code examples
cassandracassandra-2.0datastax-enterprisecassandra-2.1

What is necessary to backup the schema?


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?


Solution

  • 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