title: Downgrading to Cassandra 2
body: <p>So I screwed up and accidentally upgraded our Cassandra 2 box to Cassandra 3. The data is all intact but I need to get it back to Cassandra 2 for compatibility with other tools. I read the post here <a href="https://stackoverflow.com/questions/34634932/how-to-downgrade-cassandra-3-0-0-2-x">How to downgrade Cassandra 3.0.0 -> 2.x?</a> and I'm ok with having to manually float the data around if that's what it takes (it's not THAT much data). </p>
  
  <p>The upgrade was accidentally done using <code>apt-get dist-upgrade</code> but nothing was done afterwards, there's a comment asking about using <code>nodetool</code>, it wasn't run unless it's part of the <code>apt-get process</code>. I know just about 0 about managing Cassandra.</p>
  
  <p>I've built a new Cassandra 2 server with the following versions:</p>
  
  <pre><code>[cqlsh 4.1.1 | Cassandra 2.0.17 | CQL spec 3.1.1 | Thrift protocol 19.39.0]
  </code></pre>
  
  <p>The Cassandra 3 server is on versions:</p>
  
  <pre><code>[cqlsh 5.0.1 | Cassandra 3.0.6 | CQL spec 3.4.0 | Native protocol v4]
  </code></pre>
  
  <p>I used the <code>COPY</code> command to export all of the <em>data</em> into CSV files and used the <code>DESC</code> on the keyspace to have it show all the tables and their respective headers and types.</p>
  
  <p>If I try to use the <code>.cql</code> file I created from the <code>DESC</code> command to rebuild the keyspace and tables, it fails:</p>
  
  <pre><code>cqlsh -u cassandra -p cassandra -f "mykeyspace.cql"
  mykeyspace.cql:22:Bad Request: Unknown property 'crc_check_chance'
  mykeyspace.cql:40:Bad Request: Unknown property 'crc_check_chance'
  mykeyspace.cql:57:Bad Request: Unknown property 'crc_check_chance'
  ...
  </code></pre>
  
  <p>It appears to create the keyspace as I can browse it in <code>cqlsh</code> but it doesn't have any tables so I can't import the data from CSV.</p>
  
  <p>I thought maybe the crc_check_chance was a new thing introduced in 3.x, so I tried removing it and re-running the <code>.cql</code> file after dropping the keyspace, but it still fails, just on some other option.</p>
  
  <p>What can I do to get this data back into Cassandra 2?</p>
  
  <p>EDIT: Here's one table from the export I have from my (current) Cassandra 3 instance:</p>
  
  <pre><code>CREATE TABLE mykeyspace.users (
      username text PRIMARY KEY,
      first_name text,
      last_name text,
      roles set&lt;text&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>
  
  <p>This fails, but if I remove the following fields, it seems to build the table:</p>
  
  <pre><code>    AND crc_check_chance = 1.0
      AND min_index_interval = 128
      AND max_index_interval = 2048
      AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
  </code></pre>
  
  <p>Even though the table is created, the data fails to import from CSV, which could be me not using the command correctly:</p>
  
  <pre><code>cqlsh&gt; USE mykeyspace;
  cqlsh:mykeyspace&gt; COPY users FROM '/home/user/cassandra/users.csv';
  Bad Request: line 1:118 no viable alternative at input ')'
  Aborting import at record #0 (line 1). Previously-inserted values still present.
  </code></pre>