Chapter 4. Backup Sources

You can configure multiple Backups in one configuration file. Each backup is represented by a <backup> Tag. To configure the data that is stored use the <source> Tag.

Table 4.1. Supported types of backup sources:

TypeDescription
arangodumpBackup ArangoDB with the arangodump command line tool.
mongodumpBackup MongoDB with the mongodump command line tool.
mysqldumpBackup MySQL with the mysqldump command line tool.
redisBackup redis with the redis-cli command line tool.
tarBackup a directory with the tar command line tool.
xtrabackupBackup MySQL with the percona xtrabackup command line tool.


ArangoDB

Backup a ArangoDB database with arangodump.

Table 4.2. arangodump-Options

NameValueRequiredDefaultDescription
endpointstringnotcp://localhost:8529URI to your ArangoDB endpoint.
usernamestringnonullUsername for the ArangoDB authentication.
passwordstringnonullPassword for the ArangoDB authentication.
disableAuthenticationbooleannofalseDisable the ArangoDB authentication.
databasestringno_systemDatabase to backup.
dumpDatabooleannotrueDump database data.
includeSystemCollectionsbooleannofalseDump system collections as well.
collectionsstringnoallList of collections to dump.
showStdErrbooleannofalseShow stdErr for debugging.


Example 4.1: arangodump XML example

<!-- source arangodump -->
<source type="arangodump">
  <option name="database" value="myDatabase" />
  <option name="dumpData" value="true" />
  <option name="collections" value="myCollection1,myCollection2" />
</source>


Example 4.2: arangodump JSON example

{
  "type": "arangodump",
  "options": {
    "database": "myDatabase",
    "dumpData": "true",
    "collections": "myCollection1,myCollection2"
  }
}


MongoDB

Backup a MongoDB database with mongodump.

Table 4.3. mongodump-Options

NameValueRequiredDefaultDescription
hoststringnolocalhostHostname of your MongoDB-Server.
userstringnoOS-UserUsername for the MongoDB authentication.
passwordstringnonullPassword for the MongoDB authentication.
authenticationDatabasestringnonullMongoDB database that holds the user credentials.
databasesstringnoallList of databases you want to backup, all by default.
excludeCollectionsstringnonullList of collections you don't want to backup.
excludeCollectionsWithPrefixstringnonullList of collection prefixes to exclude matching collections from backup.
showStdErrbooleannofalseShow stdErr for debugging.


Example 4.3: mongodump XML example

<!-- source mongodump -->
<source type="mongodump">
  <option name="databases" value="myDatabase"/>
  <option name="user" value="user.name"/>
  <option name="password" value="topsecret"/>
  <option name="excludeCollections" value="collectionFoo,collectionBar"/>
</source>


Example 4.4: mongodump JSON example

{
  "type": "mongodump",
  "options": {
    "databases": "myDatabase",
    "user": "user.name",
    "password": "topsecret",
    "excludeCollections": "collectionFoo,collectionBar"
  }
}


MySQL - mysqldump

Backup a MySQL database with mysqldump.

Table 4.4. mysqldump-Options

NameValueRequiredDefaultDescription
hoststringnolocalhostHostname of your MySQL-Server.
userstringnoOS-UserUsername for the MySQL authentication.
passwordstringnonullPassword for the MySQL authentication.
databasesstringnoallList of databases you want to backup, all by default.
ignoreTablesstringnonullList of tables you don't want to backup.
structureOnlystringnonullList of tables where only the table structure will be stored.
hexBlobtrue | falsenofalseUse the --hex-blob option to dump blog fields in hex.
lockTablestrue | falsenonullUse the --lock-tables option to lock tables during the dump.
extendedInserttrue | falsenofalseUse multiple-row INSERT syntax. This results in a smaller dump file and speeds up inserts when the file is reloaded.
showStdErrbooleannofalseShow stdErr for debugging.


Example 4.5: mysqldump XML example

<!-- source mysqldump -->
<source type="mysqldump">
  <option name="databases" value="myDatabase"/>
  <option name="user" value="user.name"/>
  <option name="password" value="topsecret"/>
  <option name="ignoreTable" value="tableFoo,tableBar"/>
  <option name="structureOnly" value="logTable1,logTable2"/>
</source>


Example 4.6: mysqldump JSON example

{
  "type": "mysqldump",
  "options": {
    "databases": "myDatabase",
    "user": "user.name",
    "password": "topsecret",
    "ignoreTable": "tableFoo,tableBar",
    "structureOnly": "logTable1,logTable2"
  }
}


MySQL - xtrabackup

Backup a MySQL database with percona xtrabackup.

Table 4.5. xtrabackup-options

NameValueRequiredDefaultDescription
dataDirstringno MySQL data directory.
hoststringnolocalhostHost to connect to.
userstringnoOS-UserUser to connect with.
passwordstringnofalsePassword to authenticate the user.
databasesstringno-List of databases to backup, all by default.
includestringno-Pattern to include databases and tables to the backup e.g. ^mydatabase[.]mytable.
showStdErrbooleannofalseShow stdErr for debugging.


Example 4.7: xtrabackup XML example

<!-- source xtrabackup -->
<source type="xtrabackup">
  <option name="databases" value="myDB1,myDB2" />
</source>


Example 4.8: xtrabackup JSON example

{
  "type": "xtrabackup",
  "options": {
    "databases": "myDB1,myDB2"
  }
}


redis

Backup redis data structure store using redis-cli.

Table 4.6. tar-Options

NameValueRequiredDefaultDescription
pathToRedisDatastringyes-Path to the redis data .rdb file.
pathToRedisClistringno-Path to the redis-cli binary.
portintegerno6379Port to use to connect to the redis server.
passwordstringno-Password to use to authenticate.
showStdErrbooleannofalseShow stdErr for debugging.


Example 4.9: redis XML example

<!-- source redis -->
<source type="redis">
  <option name="pathToRedisData" value="/var/lib/redis/6379/dump.rdb"/>
</source>


Example 4.10: redis JSON example

{
  "type": "redis",
  "options": {
    "pathToRedisData": "/var/lib/redis/6379/dump.rdb"
  }
}


Directories

Backup directories using tar.

Table 4.7. tar-Options

NameValueRequiredDefaultDescription
pathstringyes-Path to the source directory.
showStdErrbooleannofalseShow stdErr for debugging.


Example 4.11: tar XML example

<!-- source tar -->
<source type="tar">
  <option name="path" value="htdocs/uploads"/>
</source>


Example 4.12: tar JSON example

{
  "type": "tar",
  "options": {
    "path": "htdocs/uploads"
  }
}


Please open a ticket on GitHub to suggest improvements to this page. Thanks!