ArangoDB v3.13 is under development and not released yet. This documentation is not final and potentially incomplete.
HTTP interface for Hot Backups
The HTTP API for Hot Backups lets you manage incremental, zero-downtime data backups
Hot Backups are near instantaneous consistent snapshots of an entire ArangoDB deployment. This includes all databases, collections, indexes, Views, graphs, and users at any given time.
For creations a label may be specified, which if omitted is replaced with a generated UUID. This label is then combined with a timestamp to generate an identifier for the created hot backup. Subsequently, all other APIs operate on these identifiers.
The permissions required to use the /_admin/backup/*
endpoints depends on the
setting of the --backup.options-api
startup option.
Create a backup
force boolean (default:
false
)If this flag is set to
true
and no global transaction lock can be acquired within the given timeout, all running transactions are forcefully aborted to ensure that a consistent backup can be created. This does not include JavaScript transactions. It waits for the transactions to be aborted at mosttimeout
seconds. Thus usingforce
the request timeout is doubled. To abort transactions is almost certainly not what you want for your application. In the presence of intermediate commits it can even destroy the atomicity of your transactions. Use at your own risk, and only if you need a consistent backup at all costs. The default and recommended value isfalse
. If bothallowInconsistent
andforce
are set totrue
, then the latter takes precedence and transactions are aborted. This is only available in the cluster.
Examples
curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_admin/backup/create
{
"label": "foo"
}
Show output
HTTP/1.1 201 Created
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 186
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 201,
"result" : {
"id" : "2024-03-11T19.03.42Z_foo",
"potentiallyInconsistent" : false,
"sizeInBytes" : 7684789,
"datetime" : "2024-03-11T19:03:42Z",
"nrDBServers" : 1,
"nrFiles" : 23
}
}
Restore a backup
200 OK
Is returned if the backup could be restored. Note that there is an inevitable discrepancy between the single server and the cluster. In a single server, the request returns successfully, but the restore is only executed afterwards. In the cluster, the request only returns when the restore operation has been completed successfully. The cluster behavior is obviously the desired one, but in a single instance, one cannot keep a connection open across a restart.
Examples
curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_admin/backup/restore
{
"id": "2024-03-11T19.03.42Z_538c5497-3fe1-4df3-9284-b485c3c26245"
}
Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 97
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"result" : {
"previous" : "/var/lib/arangodb3/backups/DIRECTORY_TO_DELETE"
}
}
Delete a backup
id
.Examples
curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_admin/backup/delete
{
"id": "2024-03-11T19.03.45Z_0bbb3d5b-567a-4ea8-b3ca-16006746f7ac"
}
Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 38
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"result" : {
}
}
List all backups
Examples
curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_admin/backup/list
{}
Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 1461
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"result" : {
"server" : "SNGL-1df8ac4b-6135-4ad0-93e2-b3179b899069",
"list" : {
"2024-03-11T19.03.45Z_fa480a57-4762-49a2-a1f9-b0fccdd39bbf" : {
"id" : "2024-03-11T19.03.45Z_fa480a57-4762-49a2-a1f9-b0fccdd39bbf",
"version" : "3.12.0-nightly.20240305",
"datetime" : "2024-03-11T19:03:45Z",
"keys" : [ ],
"sizeInBytes" : 7795295,
"nrFiles" : 30,
"nrDBServers" : 1,
"available" : true,
"nrPiecesPresent" : 1,
"potentiallyInconsistent" : false,
"countIncludesFilesOnly" : true
},
"2024-03-11T19.03.42Z_538c5497-3fe1-4df3-9284-b485c3c26245" : {
"id" : "2024-03-11T19.03.42Z_538c5497-3fe1-4df3-9284-b485c3c26245",
"version" : "3.12.0-nightly.20240305",
"datetime" : "2024-03-11T19:03:42Z",
"keys" : [ ],
"sizeInBytes" : 7745012,
"nrFiles" : 26,
"nrDBServers" : 1,
"available" : true,
"nrPiecesPresent" : 1,
"potentiallyInconsistent" : false,
"countIncludesFilesOnly" : true
},
"2024-03-11T19.03.42Z_foo" : {
"id" : "2024-03-11T19.03.42Z_foo",
"version" : "3.12.0-nightly.20240305",
"datetime" : "2024-03-11T19:03:42Z",
"keys" : [ ],
"sizeInBytes" : 7684789,
"nrFiles" : 23,
"nrDBServers" : 1,
"available" : true,
"nrPiecesPresent" : 1,
"potentiallyInconsistent" : false,
"countIncludesFilesOnly" : true
},
"2024-03-11T19.03.45Z_007a31d4-5658-4ffe-9739-3fd0cbe05306" : {
"id" : "2024-03-11T19.03.45Z_007a31d4-5658-4ffe-9739-3fd0cbe05306",
"version" : "3.12.0-nightly.20240305",
"datetime" : "2024-03-11T19:03:45Z",
"keys" : [ ],
"sizeInBytes" : 7798271,
"nrFiles" : 25,
"nrDBServers" : 1,
"available" : true,
"nrPiecesPresent" : 1,
"potentiallyInconsistent" : false,
"countIncludesFilesOnly" : true
}
}
}
}
Upload a backup to a remote repository
config object
Configuration of remote repository. This is required when an upload operation is scheduled. In this case leave out the
uploadId
attribute. See Rclone Configuration for a description of theconfig
object.remoteRepository string
URL of remote repository. This is required when an upload operation is scheduled. In this case leave out the
uploadId
attribute. Provided repository URLs are normalized and validated as follows: One single colon must appear separating the configuration section name and the path. The URL prefix up to the colon must exist as a key in the config object below. No slashes must appear before the colon. Multiple back to back slashes are collapsed to one, as..
and.
are applied accordingly. Local repositories must be absolute paths and must begin with a/
. Trailing/
are removed.
Examples
curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_admin/backup/upload
{
"id": "2024-03-11T19.03.45Z_eed916f4-46cf-4dce-8cee-f156716a9fec",
"remoteRepository": "local://tmp/backups",
"config": {
"local": {
"type": "local"
}
}
}
Show output
HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 56
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 202,
"result" : {
"uploadId" : "68564"
}
}
The result
object of the body holds the uploadId
string attribute which can
be used to follow the upload process.
curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_admin/backup/upload
{
"uploadId": "68604"
}
Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 222
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"result" : {
"Timestamp" : "2024-03-11T19:03:45Z",
"UploadId" : "68604",
"Cancelled" : false,
"BackupId" : "2024-03-11T19.03.45Z_37d1e890-5c4a-4758-8d38-5902caab612b",
"DBServers" : {
"SNGL" : {
"Status" : "STARTED"
}
}
}
}
Download a backup from a remote repository
config* object
Configuration of remote repository. This is required when a download operation is scheduled. In this case leave out the
downloadId
attribute. See Rclone Configuration for a description of theconfig
object.remoteRepository* string
URL of remote repository. This is required when a download operation is scheduled. In this case leave out the
downloadId
attribute. Provided repository URLs are normalized and validated as follows: One single colon must appear separating the configuration section name and the path. The URL prefix up to the colon must exist as a key in the config object below. No slashes must appear before the colon. Multiple back to back slashes are collapsed to one, as..
and.
are applied accordingly. Local repositories must be absolute paths and must begin with a/
. Trailing/
are removed.
Examples
curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_admin/backup/download
{
"id": "2024-03-11T19.03.45Z_81ef7b20-1787-41a4-956a-1e3835965141",
"remoteRepository": "local://tmp/backups",
"config": {
"local": {
"type": "local"
}
}
}
Show output
HTTP/1.1 202 Accepted
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 58
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 202,
"result" : {
"downloadId" : "68652"
}
}
The result
object of the body holds the downloadId
string attribute which
can be used to follow the download process.
curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_admin/backup/download
{
"downloadId": "68694"
}
Show output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 224
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"error" : false,
"code" : 200,
"result" : {
"Timestamp" : "2024-03-11T19:04:16Z",
"DownloadId" : "68694",
"Cancelled" : false,
"BackupId" : "2024-03-11T19.04.01Z_98e3a872-be5d-4822-a9ae-bfa39fcc6188",
"DBServers" : {
"SNGL" : {
"Status" : "STARTED"
}
}
}
}