diff --git a/content/rancher/v2.x/en/backups/backups/single-node-backups/_index.md b/content/rancher/v2.x/en/backups/backups/single-node-backups/_index.md index d8bc7910d9c..0f511c99809 100644 --- a/content/rancher/v2.x/en/backups/backups/single-node-backups/_index.md +++ b/content/rancher/v2.x/en/backups/backups/single-node-backups/_index.md @@ -6,41 +6,44 @@ aliases: - /rancher/v2.x/en/installation/backups-and-restoration/single-node-backup-and-restoration/ --- -After completing your single node installation of Rancher, you can create a backup of your current installation at any time. We recommend making a backup before [upgrading]({{< baseurl >}}/rancher/v2.x/en/upgrades/single-node-upgrade/). Use this backup as a restoration point in disaster scenarios or when you need to [rollback]({{< baseurl >}}/rancher/v2.x/en/backups/rollbacks/single-node-rollbacks/) to an older version. +After completing your single node installation of Rancher, we recommend creating backups of it on a regular basis. Use these backups as a restoration point in a disaster scenario. ->**Prerequisite:** Open Rancher and write down the version number displayed in the lower-left of the browser (example: `v2.0.0`). You'll need this number during the backup process. + -1. Stop the container currently running Rancher Server. Replace `` with the ID of your Rancher container. +>**Prerequisite:** Open Rancher and write down the version number displayed in the lower-left of the browser (example: `v2.0.5`). You'll need this number during the backup process. +> +>![Version Number]({{< baseurl >}}/img/rancher/rancher-version.png) + +1. Using a remote Terminal connection, log into your Rancher Server. + +1. Stop the container currently running Rancher Server. Replace `` with the name of your Rancher container. ``` -docker stop + docker stop + ``` + You can obtain the name for your Rancher container by entering `docker ps`. + ![Stop Rancher Container]({{< baseurl >}}/img/rancher/docker-container-ps-output.png) + +1. Using the command below, create a data container from the Rancher container you just stopped. + + - Replace `` with the name from the previous step (our example uses `festive_mestorf`). + - Replace `` with the version of Rancher that you are currently running, as mentioned in the [Prerequisite](#prereq) (`v2.0.5` in our example). + - Replace `` with tag of your Rancher image (`v2.0.5` in our example). + + ``` + docker create --volumes-from --name rancher-data- rancher/rancher: ``` - >**Tip:** You can obtain the ID for your Rancher container by entering the following command: `docker ps`. - -2. Create a data container. This container contains the data from your current Rancher Server, and can be used to start Rancher Server. - - - Replace `` with the same ID from the previous step. - - Replace `` and `` with the version of Rancher that you are currently running, as mentioned in the **Prerequisite** above. +1. From the data container that you just created (`rancher-data-`), create a backup tarball (`rancher-data-backup-.tar.gz`). ``` -docker create --volumes-from \ ---name rancher-data- rancher/rancher: + docker run --volumes-from rancher-data- -v $PWD:/backup alpine tar zcvf /backup/rancher-data-backup-.tar.gz /var/lib/rancher ``` -3. During upgrade, you point to a Rancher server to the same Rancher data container and the Rancher data in the data container will continue to be updated/changed. Therefore, you need to get a snapshot of the data to be used for disaster recovery or in case you need to rollback the upgrade. +1. Restart Rancher Server. Replace `` with the name of your Rancher container. ``` -docker run --volumes-from rancher-data- \ --v $PWD:/backup alpine tar zcvf \ -/backup/rancher-data-backup-.tar.gz /var/lib/rancher + docker start ``` -3. After you've created your backup, you can either restart Rancher server or [upgrade]({{< baseurl >}}/rancher/v2.x/en/upgrades/single-node-upgrade/). Replace `` with the ID of your Rancher container. - - ``` -# Restart Rancher server -docker start - ``` - -**Result:** A backup of your Rancher Server is created. If you ever need to restore your backup, see [Restoring Backups: Single Node Installs]({{< baseurl >}}/rancher/v2.x/en/upgrades/restorations/single-node-restoration). +**Result:** A backup tarball of your Rancher Server data is created. Make note of the current directory, as this is where the tarball resides. See [Restoring Backups: Single Node Installs]({{< baseurl >}}/rancher/v2.x/en/backups/restorations/single-node-restoration) if you need to restore backup data. diff --git a/src/img/rancher/docker-container-ps-output.png b/src/img/rancher/docker-container-ps-output.png new file mode 100644 index 00000000000..edd911fb566 Binary files /dev/null and b/src/img/rancher/docker-container-ps-output.png differ diff --git a/src/img/rancher/rancher-version.png b/src/img/rancher/rancher-version.png new file mode 100644 index 00000000000..cb0cc67c13a Binary files /dev/null and b/src/img/rancher/rancher-version.png differ diff --git a/src/img/rancher/stop-rancher-container.gif b/src/img/rancher/stop-rancher-container.gif new file mode 100644 index 00000000000..92468116973 Binary files /dev/null and b/src/img/rancher/stop-rancher-container.gif differ