Question

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.

Was it helpful?

Solution

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 FROM:

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:

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top