Backup

Create backup interface

Changed on

Create a backup with the given name and collections Storage preflight failures return HTTP 200 with code 503 (Storage_Not_Ready), without registering a task. The caller may retry the same request. A backup name whose artifact directory already exists fails with code Fail, also without registering a task.

post/create

Request

  • Base URL
    /api/v1 (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    none declared

Headers

request_idstring

request_id

Request body

asyncboolean

Async or not: return after the job is registered instead of waiting for it to settle.

backup_namestring

Backup name, validated server-side: numbers, letters and underscores.

backup_root_pathstring

Backup root path, overriding the config for this call.

collection_namesstring[]

Collection names to backup, empty to backup all.

Deprecated: use filter.

db_collectionsstring

Database and collections to backup. Accepts both shapes it always has: a JSON string holding a JSON object, or the object itself.

Deprecated: use filter.

drop_snapshot_if_existsboolean

Drop a snapshot of the same name before creating the backup's own, so a leftover from an earlier run that died mid-flight cannot fail the create. Snapshot format only.

filterobject

Filter for backup: database name to its collection list.

forceboolean

Force backup skip flush. Data must already be on disk when using it.

Deprecated: set strategy=skip_flush instead.

formatstring

Format for backup, one of [auto, binlog, snapshot]; auto selects when unset.

gc_pause_addressstring

Gc pause API address.

gc_pause_enableboolean

Stop GC during the backup so the data to backup is not compacted or GCed away; use it when the data is very large.

gc_pause_secondsinteger

Gc pause seconds, set it larger than the time cost of the backup.

Deprecated: the server derives it from the config.

meta_onlyboolean

Only backup meta, including collection schema and index info.

Deprecated: set strategy=meta_only instead.

rbacboolean

Whether backup RBAC.

requestIdstring

Uuid of request, defaults to a generated one when unset.

strategystring

Strategy for backup, one of [meta_only, skip_flush, bulk_flush, serial_flush]; auto selects when unset.

with_index_extraboolean

Also copy index-extra params (build_level and friends) verbatim.

Response

OK

code0 | 1 | 2 | 3 | 400 | 404 | 503
msgstring

Error msg if fail.

requestIdstring

Uuid of the request answered.

Changes