Ram
Ram

Reputation: 324

Migrate data from cassandra to cassandra

We have 2 cassandra clusters, first one has the old data and second one has the new data.

Now we want to move or copy the old data from first cluster to second. What is the best way to do this and how to do this?

we are using DSE 3.1.4.

Upvotes: 5

Views: 7273

Answers (2)

Aaron
Aaron

Reputation: 57808

One tool you could try would be the COPY TO/FROM cqlsh command.

On a node in the old cluster, you would use the COPY TO:

cqlsh> COPY myTable (col1, col2, col3, col4) TO 'temp.csv'

And then (after copying the file over) on a node in your new cluster, you would copy the data in the CSV file into Cassandra:

cqlsh> COPY myTable (col1, col2, col3, col4) FROM 'temp.csv'

Here is some more documentation on the COPY command.

Note that the COPY TO/FROM is recommended for tables that contain only a few million rows or less. For larger datasets you should look at:

Upvotes: 5

Roman Tumaykin
Roman Tumaykin

Reputation: 1931

There is a tool called /usr/bin/sstableloader for copying data between the clusters. Although when I used it months ago, I encountered an error and used this instead. But since it was a long time ago, sstableloader might have been fixed already.

Upvotes: 2

Related Questions