snapshotconvert

Documentation

VoltDB Home » Documentation » Administrator's Guide

snapshotconvert

snapshotconvert — Converts the tables in a VoltDB snapshot into text files.

Synopsis

snapshotconvert {snapshot-id} --type {csv|tsv} \
--table {table} [...] [--dir {directory}]... \
[--outdir {directory}]

snapshotconvert --help

Description

SnapshotConverter converts one or more tables in a valid snapshot into either comma-separated (csv) or tab-separated (tsv) text files, creating one file per table.

Where:

{snapshot-id}

is the unique identifier specified when the snapshot was created. (It is also the name of the .digest file that is part of the snapshot.) You must specify a snapshot ID.

{csv|tsv}

is either "csv" or "tsv" and specifies whether the output file is comma-separated or tab-separated. This argument is also used as the filetype of the output files.

{table}

is the name of the database table that you want to export to text file. You can specify the --table argument multiple times to convert multiple tables with a single command.

{directory}

is the directory to search for the snapshot (--dir) or where to create the resulting output files (--outdir). You can specify the --dir argument multiple times to search multiple directories for the snapshot files. Both --dir and --outdir are optional; they default to the current directory path.

Example

The following command exports two tables from a snapshot of the flight reservation example used in the Using VoltDB manual. The utility searches for the snapshot files in the current directory (the default) and creates one file per table in the user's home directory:

$ snapshotconvert flightsnap --table CUSTOMER --table RESERVATION \ 
                  --type csv -- outdir ~/