Migrating encrypted tables from earlier versions

Steps to migrate encrypted tables from earlier versions to the latest version of DataStax Enterprise.

It is important to note that if any old key is lost in the process of migration, the data will be lost forever. Exercise caution when using this procedure!

Procedure

  1. Back up the entire keyspace that has a dse_system.encrypted_keys table.

  2. Back up all system keys.

  3. Upgrade the cluster to DataStax Enterprise 5.1, following the DataStax Upgrade Guide instructions.

  4. Restart the cluster.

  5. Check that the dse_system.encrypted_keys table was created using the cqlsh DESCRIBE KEYSPACES command.

    If you need to restore the dse_system.encrypted_keys table, load the table. Do not truncate or delete anything.

  6. If the dse_system.encrypted_keys table was created, go to the next step; otherwise, create the table manually:

    CREATE KEYSPACE dse_system WITH replication = {'class': 'EverywhereStrategy'};
    
    USE dse_system;
    
    CREATE TABLE encrypted_keys (
      key_file text,
      cipher text,
      strength int,
      key_id timeuuid,
      key text,
      PRIMARY KEY (key_file, cipher, strength, key_id)
    );

    EverywhereStrategy is the default replication strategy for the dse_system and solr_admin keyspaces. Do not use or alter any other instances of EverywhereStrategy.

  7. Rewrite all SSTables.

    nodetool upgradesstables --include-all-sstables
  8. Verify if the search index files are encrypted:

    dsetool list_index_files <keyspace_name>.<table_name>
  9. Perform offline index encryption.

    Requirements:

    • The remote node that contains the encryption configuration must be running.

    • The local node is offline.

    • The user that runs this command must have read and write permissions to the directory that contains the index files.

      dsetool upgrade_index_files <keyspace_name>.<table_name> -h <IP_address> [<options>]

    You can specify the following options:

    keyspace_name.table_name

    Required. The keyspace and table names of the search index. Keyspace and table names are case-sensitive. Enclose names that contain uppercase in double quotation marks.

    -h IP_address

    Required. Node hostname or IP address of the remote node that contains the encryption configuration that is used for index encryption. The remote node must be running.

    -c port

    The DSE port on the remote node that contains the encryption configuration.

    --backup

    Preserves the index files from the current index as a backup after successful upgrade. The preserved index file backup is moved to the --workspace directory. When not specified, index files from the current index are deleted.

    --workspace directory

    The workspace directory for the upgrade process. The upgraded index is created in this directory. When not specified, the default directory is the same directory that contains the search index files.

    --index directory

    The data directory that contains the search index files. When not specified, the default directory is inferred from the search index name.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com