Arangodump Examples

    This will connect to an ArangoDB server and dump all non-system collections fromthe default database (_system) into an output directory named dump.Invoking arangodump will fail if the output directory already exists. This isan intentional security measure to prevent you from accidentally overwriting alreadydumped data. If you are positive that you want to overwrite data in the outputdirectory, you can use the parameter —overwrite true to confirm this:

    arangodump will by default connect to the _system database using the defaultendpoint. To override the endpoint, or specify a different user, use one of thefollowing startup options:

    • —server.endpoint <string>: endpoint to connect to
    • —server.username <string>: username
    • —server.password <string>: password to use (omit this and you’ll be prompted for thepassword)
    • —server.authentication <bool>: whether or not to use authentication

    If you want to connect to a different database or dump all databases you can additionalyuse the following startup options:

    • —all-databases true: must have access to all databases, and not specify a database.

    Note that the specified user must have access to the databases.

    Here’s an example of dumping data from a non-standard endpoint, using a dedicated:

    1. arangodump --server.endpoint tcp://192.168.173.13:8531 --server.username backup --server.database mydb --output-directory "dump"

    In contrast to the above call —server.database must not be specified when dumpingall databases using —all-databases true:

    1. arangodump --server.endpoint tcp://192.168.173.13:8531 --server.username backup --all-databases true --output-directory "dump-multiple"

    When finished, arangodump will print out a summary line with some aggregatestatistics about what it did, e.g.:

    1. Processed 43 collection(s), wrote 408173500 byte(s) into datafiles, sent 88 batch(es)

    By default, arangodump will dump both structural information and documents from allnon-system collections. To adjust this, there are the following command-linearguments:

    • —dump-data <bool>: set to true to include documents in the dump. Set to false_to exclude documents. The default value is _true.
    • : whether or not to include system collectionsin the dump. The default value is false. Set to true if you are using namedgraphs that you are interested in restoring.

    For example, to only dump structural information of all collections (including systemcollections), use:

    To restrict the dump to just specific collections, there is is the —collection option.It can be specified multiple times if required:

    1. arangodump --collection myusers --collection myvalues --output-directory "dump"

    Structural information for a collection will be saved in files with name pattern.structure.json. Each structure file will contains a JSON objectwith these attributes:

    • parameters: contains the collection properties
    • indexes: contains the collection indexes

    Starting with Version 2.1 of ArangoDB, the arangodump tool alsosupports sharding and can be used to backup data from a Cluster.Simply point it to one of the Coordinators and itwill behave exactly as described above, working on sharded collectionsin the Cluster.

    Please see the Limitations.

    As above, the output will be one structure description file and one datafile per sharded collection. Note that the data in the data file issorted first by shards and within each shard by ascending timestamp. Thestructural information of the collection contains the number of shardsand the shard keys.

    Note that the version of the arangodump client tool needs to match theversion of the ArangoDB server it connects to.

    Starting with version 3.1.17, collections may beidentical to an existing prototypical collection; i.e. shards are distributed inthe very same pattern as in the prototype collection. Such collections cannot bedumped without the referenced collection or arangodump yields an error.

    1. arangodump --collection clonedCollection --output-directory "dump"

    There are two ways to approach that problem.Dump the prototype collection as well:

    1. arangodump --collection clonedCollection --collection prototypeCollection --output-directory "dump"
    2. Processed 2 collection(s), wrote 81920 byte(s) into datafiles, sent 1 batch(es)

    Or override that behavior to be able to dump the collection in isolationindividually:

    1. arangodump --collection clonedCollection --output-directory "dump" --ignore-distribute-shards-like-errors
    2. Processed 1 collection(s), wrote 34217 byte(s) into datafiles, sent 1 batch(es)

    Note that in consequence, restoring such a collection without its prototype isaffected. See documentation on arangorestore formore details about restoring the collection.

    Dump encryption is only available in the,also available as managed service.

    Starting from version 3.3 encryption of the dump is supported.

    The dump is encrypted using an encryption keyfile, which must contain exactly 32bytes of data (required by the AES block cipher).

    For security reasons, it is best to create these keys offline (away from yourdatabase servers) and directly store them in your secret managementtool.

    In order to create an encrypted backup, add the —encryption.keyfileoption when invoking arangodump, in addition to any other option youare already using. The following example assumes that your secret keyis stored in ~/SECRET-KEY:

    1. arangodump --collection "secret-collection" dump --encryption.keyfile ~/SECRET-KEY

    Note that arangodump will not store the key anywhere. It is the responsibilityof the user to find a safe place for the key. However, arangodump will storethe used encryption method in a file named in the dump directory.That way arangorestore can later find out whether it is dealing with anencrypted dump or not.

    Trying to restore the encrypted dump without specifying the key will fail:

    1. arangorestore --collection "secret-collection" dump --create-collection true

    and arangorestore will report the following error:

    1. the dump data seems to be encrypted with aes-256-ctr, but no key information was specified to decrypt the dump
    2. it is recommended to specify either `--encryption.keyfile` or `--encryption.key-generator` when invoking arangorestore with an encrypted dump

    It is required to use the exact same key when restoring the data. Again this isdone by providing the —encryption.keyfile parameter:

      Using a different key will lead to the backup being non-recoverable.

      Note that encrypted backups can be used together with the already existingRocksDB encryption-at-rest feature, but they can also be used for the MMFilesengine, which does not have encryption-at-rest.

      Introduced in: v3.4.6, v3.5.0

      —compress-output

      Data can optionally be dumped in a compressed format to save space on disk.The —compress-output option can not be used together with .

      Compressed dumps can be restored with arangorestore, which automaticallydetects whether the data is compressed or not based on the file extension.

      1. arangorestore --input-directory "dump"