title: How to reliably copy Cassandra database between two server?
body: <p>I have a test setup where I would like to have a copy of master data.</p>
  
  <p>I'm using Cassandra package from datastax, version 3.0.9</p>
  
  <p>I'm using CQLSH to take a dump of data, and restore in on test setup.
  I'm taking a copy of the master data by using</p>
  
  <blockquote>
    <p>COPY  TO  WITH DELIMITER = '\t' AND NULL = 'null' AND QUOTE = '"' AND HEADER = True</p>
  </blockquote>
  
  <p>I'm populating the data using</p>
  
  <blockquote>
    <p>COPY  FROM  WITH DELIMITER = '\t' AND NULL = 'null' AND QUOTE = '"' AND HEADER = True</p>
  </blockquote>
  
  <p>After COPY_FROM, CQLSH says that it successfully copied all the rows from the file. But when I run a count(*) on the table, a few rows are missing.
  There is no particular pattern to missing rows. If I replay the command after truncating the table, a new set of rows go missing. The count of the missing rows is random.</p>
  
  <p>The table structure contains lists/sets of User Defined Datatypes, with possible 'null' values in the contents of UDT.</p>
  
  <p>Is there any other reliable way to copy data, other than to programmatically read and write individual rows between the two database?</p>
  
  <hr>
  
  <p>Schema of the table (<em>field names changed</em>):</p>
  
  <pre><code>CREATE TYPE UDT1 (
     field1 text,
     field2 int,
     field3 text
  );
  
  CREATE TYPE UDT2 (
     field1 boolean,
     field2 float
  );
  
  CREATE TABLE cypher.table1 (
     id int PRIMARY KEY,
     list1 list&lt;frozen&lt;UDT1&gt;&gt;,
     data text,
     set1 set&lt;frozen&lt;UDT2&gt;&gt;
  ) WITH bloom_filter_fp_chance = 0.01
      AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
      AND comment = ''
      AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
      AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
      AND crc_check_chance = 1.0
      AND dclocal_read_repair_chance = 0.1
      AND default_time_to_live = 0
      AND gc_grace_seconds = 864000
      AND max_index_interval = 2048
      AND memtable_flush_period_in_ms = 0
      AND min_index_interval = 128
      AND read_repair_chance = 0.0
      AND speculative_retry = '99PERCENTILE';
  </code></pre>