Reputation: 100
I have 6 keyspaces in cassandra database. I want to migrate all my keyspaces schemas in another cassandra database. How can I do it at once?
Upvotes: 0
Views: 66
Reputation: 6218
You can run following command to write the scema in cql file
cqlsh -e "Desc keyspace keyspacename" > 'out.cql'
and then use SOURCE
to import cql file on another host OR cqlsh -f out.cql optionalHostname
Upvotes: 1
Reputation: 6667
DESCRIBE SCHEMA;
will give you DDL statements needed to recreate the non-system keyspaces and tables on a new cluster.
Upvotes: 1