0
votes

I tried exporting cassandra keyspace from windows single node instance on CQlshell command with the following command

cqlsh> -e 'DESCRIBE keypspace demo' > dump.cql

it's not working for me. I am using cassandra version of 3.5.0 and cqlsh version of 5.0.1 and CQL spec 3.4.0. What I am missing here?

PS: I do need to export data along with schema

1

1 Answers

2
votes

You will have to run the following command from command prompt

Go to CASSANDRA_HOME/bin directory where CASSANDRA_HOME is directory where cassandra is installed.

cqlsh -e "DESCRIBE keypspace demo" > "dump.cql"

Note: Double quotes is required instead of single quotes.

The above command will only export the schema. Use COPY command to export the data to csv files and then import it back. Else you can also use SSTableLoader to load the data using SSTables from data directory