This tool supports maintenance operations such as backup and compaction.
To back up a repository, use:
java -mx4g -jar oak-run-*.jar backup <repository> <backup>
When using the (default) Tar storage, the <repository> setting is the path to the directory that contains the segment (data*.tar) files. The <backup> option is the target directory.
To list the checkpoints of a repository, use:
java -mx4g -jar oak-run-*.jar checkpoint <repository>
When using the (default) Tar storage, the <repository> setting is the path to the directory that contains the segment (data*.tar) files.
The oak-run compact operation may be used to perform an offline compaction:
java -mx4g -jar oak-run-*.jar compact <repository> [--force]
It makes sense to find and remove the old checkpoints, using the checkpoint command described above.
The oak-run index operation is used to manage indexes.
When performing operations on the SegmentNodeStore (eg. backup, checkpoint, compact), it’s possible to tweak various system properties to get the optimal performance. These are:
java -Dtar.memoryMapped=true -mx4g -jar oak-run-*.jar checkpoint <repository>
wget https://s.apache.org/oak-mongo.js mongo --shell oak-mongo.js
Now the MongoDB shell has an oak namespace with additional functions.