1

I need to copy data from keyspace database1 to keyspace database18.

It's not an option to use csql COPY command (at least I don't know how to make such script), because I have 103 different tables with all imaginable columns in it.

Keyspaces already created, schema applied.

I already tried to make a snapshot and then copy (mv)

1. mv /data/cassandra/data/database1/tables/snapshot/copy/* /data/cassandra/data/database18/tables/*

  1. nodetool refresh database18 tablesOneByOne
  2. nodetool repair database18

I also tried to reboot one of my servers:

  1. nodetool disablegossip

  2. nodetool drain

  3. reboot

There are no data in new keyspace tables.

When I enter csql use database18; select * from table1;

I receive an empty table "(0 rows)"

Cassandra version is: [cqlsh 5.0.1 | Cassandra 2.1.17.1439

Maybe there something I missing or different way exists to achieve this?

Any help or suggestions are welcome, thank you!!!

1 Answers1

2

I guess your options are: 1) cql copy and/or dse bulk 2) sstableloader 3) code 4) 3rd party product (we have a product for backing up and restoring - and can do so to different clusters, if desired (Formerly Talena, Formerly Imanis, Now Cohesity)

If the tables are large, and the node-count is small, I would say use sstableloader. Works well.

-Jim

JStorage
  • 229
  • 2
  • 10
Jim Wartnick
  • 1,974
  • 1
  • 9
  • 19
  • Thank you for your answer I'll try to use the options you have mentioned. In 3rd option you mean to make a script that will do it in the cycle or something? – Iliya Karin Aug 29 '19 at 11:13
  • #3 I mean writing your own java code that connects to both clusters, reads from one and writes to the other. You have complete control, but it's not ideal to write code for this every time. – Jim Wartnick Aug 29 '19 at 18:36
  • As #3 I use export/import js scripts. I posted answer on similar question here https://stackoverflow.com/a/63842723/586609 – Stanislav Berkov Sep 11 '20 at 07:44