This tool is implemented based on Cassandra 2.2.
- Java 1.8 is needed.
Open a terminal and change folder to the repository path.
Use the following command to compile the project.
Remove TTL and create new SSTable
From base directory of repo run the following. This will create the resulting SSTable in the destination directory with the same generation number.
CASSANDRA_HOME=<path_to_cassandra> ./TTLRemover <path_to_SSTable_Data.db> -p <destination_directory>
To do it on a batch of SSTables, you can use the following command:
find [full path to the sstable folder]/*Data.db -type f | xargs -I PATH ./TTLRemover PATH -p <output path>
Or you can use the command to work on an entire keyspace.
CASSANDRA_HOME=<path_to_cassandra> ./TTLRemoverKeyspace [keyspace path] -p <output path>
Load ttl-removed SSTable to a new cluster
Create the keyspace and table of the target sstable in the new cluster.
In the source cluster, use the following command to load the ttl-removed SSTable into the new cluster.
./sstableloader -d <ip address of new cluster node> [path to the ttl-removed sstable folder]
See Danyang Li's blog "TTLRemover: Tool for Removing Cassandra TTLs for Recovery and Testing Purposes"