DataStax Enterprise 2.2 Documentation

Save Old Installation Keyspaces -- Important

DataStax recommends saving your keyspaces before upgrading. Follow this procedure, which is recommended as a best practice.

To save old installation keyspaces:

  1. Create a file in a directory for which you have permission that contains the SHOW KEYSPACES command. For example:

    $ echo "SHOW KEYSPACES;" > /tmp/do_show.txt
    
  2. Start CLI, using the -f option to execute the command in the saved file. Use the redirect function to save the output to another file in a directory for which you have permission. For example:

    cd <old installation>/bin
    $ cassandra-cli -host localhost -port 9160 -f
      /tmp/do_show.txt > /tmp/my_saved_ks.txt
    
  3. Check that the file, my_saved_ks.txt, contains the schema definition output of SHOW KEYSPACES.

    less /tmp/my_saved_ks.txt
    
  4. Move the file containing the schema definition output to a safe location.

  5. Upgrade to DataStax Enterprise 2.2.x. Do not run the nodetool scrub command. Follow one of these sets of instructions:

  6. After the upgrade is complete, rerun the SHOW KEYSPACES command.

  7. Check for any drastic changes in the keyspace list.

If any keyspaces disappeared during the upgrade:

  1. Open the file containing the schema definitions that you saved in step 2 of the previous procedure.

  2. Recreate keyspaces and table definitions:

    1. Shutdown the cluster.

    2. Run the following command on the command line:

      $ rm data/system/system_schema*
      
    3. Restart the cluster.

    4. Using CQL or CLI, recreate the keyspaces and tables to replace the missing data: For example:

      cd <old installation>/bin
      ./cqlsh --cql3
      CREATE KEYSPACE <missing keyspace definition>;
      CREATE TABLE (<missing table definition>);