state.json
in
the zip file.auto-lock
was enabled on the old Swarm, the unlock key is
required to perform the restore.Important
The Swarm restore procedure must be performed only on the cluster’s one manager node. Be sure, also, to restore the backup on the same node where the original backup was made.
Shut down the Mirantis Container Runtime on the node you select for the restore:
systemctl stop docker
Remove the contents of the /var/lib/docker/swarm
directory on the
new Swarm if it exists.
Restore the /var/lib/docker/swarm
directory with the contents of
the backup.
Note: The new node uses the same encryption key for on-disk storage as the old one. It is not possible to change the on-disk storage encryption keys at this time. In the case of a swarm with auto-lock enabled, the unlock key is also the same as on the old swarm, and the unlock key is needed to restore the swarm.
Start Docker on the new node. Unlock the swarm if necessary.
systemctl start docker
Re-initialize the swarm so that the node does not attempt to connect to nodes that were part of the old swarm, and presumably no longer exist:
$ docker swarm init --force-new-cluster
Verify that the state of the swarm is as expected. This may include
application-specific tests or simply checking the output of
docker service ls
to be sure that all expected services are
present.
If you use auto-lock, rotate the unlock key.
Add the manager and worker nodes to the new swarm.
Reinstate your previous backup regimen on the new swarm.