title: Cassandra: export from one keyspace to another
body: <p>I'm still trying to figure my way in Cassandra world and I managed to successfully import some legacy stuff from a MySQL to Cassandra in a 'legacy_imports' keyspace.</p>
  
  <p>The problem is, my working version is in an other keyspace 'stats' and I'd like to keep 'legacy_imports' with me somewhere and merge it on 'stats' as well.
  So the wanted operation here is just to <strong>copy some tables</strong> (including COUNTER tables) <strong>from a keyspace to another</strong> on the same node.</p>
  
  <p>I tried to <code>COPY ... TO</code> but I had an error :
  <code>&lt;ErrorMessage code=0000 [Server error] message="com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ReadTimeoutException: Operation timed out - received only 1 responses."&gt;</code></p>
  
  <p>I also tried sstableloader but I had a hard time working with it. My data is split on 2 disks and paths looks like this :</p>
  
  <p><code>/media/disk2/cassandra/data/legacy_imports/log_by_day-1e6b7de0a90111e49471715135b1c904/snapshots/1422680322490-log_by_day/legacy_imports-log_by_day-ka-1-Data.db</code></p>
  
  <p>When I try sstableloader, in legacy_imports directory, I get : </p>
  
  <p><code>Could not retrieve endpoint ranges: 
  InvalidRequestException(why:No such keyspace: snapshots)</code></p>
  
  <p>And finally if I do it only on legacy_imports, I get :</p>
  
  <p><code>Exception in thread "main" java.lang.NullPointerException
      at org.apache.cassandra.io.sstable.SSTableLoader.&lt;init&gt;(SSTableLoader.java:71)
      at org.apache.cassandra.tools.BulkLoader.main(BulkLoader.java:79)
  </code></p>