Skip to content

Instantly share code, notes, and snippets.

@till
Created November 2, 2018 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save till/2ae9c1d7f4f7472c0537b1ef4acf7b99 to your computer and use it in GitHub Desktop.
Save till/2ae9c1d7f4f7472c0537b1ef4acf7b99 to your computer and use it in GitHub Desktop.
Backup Single-Node (non-HA) Rancher Server 2.x

Rancher 2.x uses etcd to store everything. If you don't know how to backup that, you loose all info on clusters, etc. as you upgrade Rancher Server.

Here's how to get passed that!

Get container ID:

$ docker ps|grep rancher/rancher

Create directory on host (because next time we will mount this):

$ mkdir /opt/your-org/

Copy files from container:

$ docker cp CONTAINER_ID:/var/lib/rancher /opt/your-org/

Restart Rancher Server:

$ docker run -d --restart=unless-stopped -p 80:80 -p 443:443 \
-v /opt/your-org/rancher:/var/lib/rancher rancher/rancher:stable \
--acme-domain rancher.your.org

Now backup /opt/your-org/ regulary and you are fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment