Tooling to serialize NodeState as json along with blobs
Document the export command
@@ -27,6 +27,7 @@ The following runmodes are currently available:
* tika : Performs text extraction
* unlockUpgrade : Unlock a DocumentMK upgrade to a newer version
* upgrade : Migrate existing Jackrabbit 2.x repository to Oak.
+ * export : Export repository content as json
Some of the features related to Jackrabbit 2.x are provided by oak-run-jr2 jar. See
@@ -534,6 +535,40 @@ Revisions
See the [official documentation](http://jackrabbit.apache.org/oak/docs/nodestore/documentmk.html#revisionGC).
+Export
+------
+
+Dumps the repository content under any repository path as json. It can also dump the blobs referred in the dumped content
+
+ java -jar oak-run-*.jar export -p /path/in/repo /path/of/segmentstore -o /path/of/output/dir
+
+This would create a json file `nodestates.json` in the output dir containing nodes content in json format. Blobs can be
+included via `-b=true` option. When enabled the blob would be stored under `blobs` directory of output dir
+
+It support various options which can be seen by help `-h`
+
+ $ java -jar oak-run-*.jar export -h
+ Exports NodeState as json
+
+
+ The export command supports exporting nodes from a repository in json. It also provide options to export the blobs
+ which are stored in FileDataStore format
+
+ Option Description
+ ------ -----------
+ -b, --blobs [Boolean] Export blobs also. By default blobs are not exported (default: false)
+ -d, --depth [Integer] Max depth to include in output (default: 2147483647)
+ -f, --filter <String> Filter expression as json to filter out which nodes and properties are included in
+ exported file (default: {"properties":["*", "-:childOrder"]})
+ --filter-file <File> Filter file which contains the filter json expression
+ --format <String> Export format 'json' or 'txt' (default: json)
+ -n, --max-child-nodes [Integer] Maximum number of child nodes to include for a any parent (default: 2147483647)
+ -o, --out <File> Output directory where the exported json and blobs are stored (default: .)
+ -p, --path <String> Repository path to export (default: /)
+ --pretty [Boolean] Pretty print the json output (default: true)
+
+The command can connect to any type of Oak repository. Refer to [Oak Run NodeStore Connection][1] for details
+
License
-------
@@ -555,3 +590,5 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
+[1]: https://jackrabbit.apache.org/oak/docs/features/oak-run-nodestore-connection-options.html
\ No newline at end of file
