2.5 KiB
+++ title = "restore" description = "Stream a tar file on stdin containing all local UCP data volumes." keywords= ["docker, ucp, backup, restore"] [menu.main] parent = "ucp_ref" identifier = "ucp_ref_restore" +++
docker/ucp id
Restore a UCP cluster from a backup tar file.
Usage
docker run --rm -i \
--name ucp \
-v /var/run/docker.sock:/var/run/docker.sock \
docker/ucp \
restore [command options] < backup.tar
Description
This utility will restore the state of this controller based on a tar file generated by the 'backup' command. Any UCP containers that are running on this host will be stopped prior to restoring the data. After the data is replaced, the containers will be restarted.
The full restore operation can be only performed on the same node where a backup was taken. Other controllers of the cluster need to be stopped before attempting a restore operation.
The restore operation can be also used to replicate Root CA material across controllers in the same cluster, by using the --root-ca-only flag. In this case, no controllers need to be stopped and the same backup file can be used to replicate Root CA material across multiple controllers of the same cluster.
WARNING: Existing state on this node will be lost and replaced by the contents of the backup.
When the restore operation is run using --interactive mode, the backup file needs to be mounted under /backup.tar within this container. If the --interactive flag is not set, the backup file will be read from stdin.
Options
| Option | Description |
|---|---|
--debug, -D |
Enable debug mode |
--jsonlog |
Produce json formatted output for easier parsing |
--interactive, -i |
Enable interactive mode. You will be prompted to enter all required information. |
--id |
The ID of the UCP instance to backup |
--root-ca-only |
Restore only the root CA certificates and keys on this controller node (leaving all other data intact) |
--passphrase |
Decrypt the tar file with the provided passphrase [$UCP_PASSPHRASE] |