From e9631a46134e3bdcf75e4536fa2bb793ceb017ba Mon Sep 17 00:00:00 2001 From: Denise Schannon Date: Thu, 26 Jul 2018 22:27:03 -0700 Subject: [PATCH] upgrade/rollback/backup updates --- .../backups/single-node-backups/_index.md | 22 ++++++++++--------- .../single-node-restoration/_index.md | 19 +++++++++------- .../rollbacks/single-node-rollbacks/_index.md | 18 ++++++++------- .../en/upgrades/single-node-upgrade/_index.md | 11 +++++----- 4 files changed, 38 insertions(+), 32 deletions(-) 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 4cedc3498eb..cb74a60097a 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,38 +6,40 @@ aliases: - /rancher/v2.x/en/installation/backups-and-restoration/single-node-backup-and-restoration/ --- -After completing your single node installation of Rancher create a backup of your current installation. Use this backup as a restoration point in disaster scenarios. +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. >**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. - ```bash + ``` docker stop ``` >**Tip:** You can obtain the ID for your Rancher container by entering the following command: `docker ps`. -2. Create a date container. This container contains the state data from your current Rancher Server, and will be used to start the newer version for Rancher Server. +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. - ```bash + ``` docker create --volumes-from \ --name rancher-data- rancher/rancher: ``` -3. Backup state the data from the data container. You will need this for disaster recovery or in case you need to rollback the upgrade. - ```bash -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. ``` +docker run --volumes-from rancher-data- \ +-v $PWD:/backup alpine tar zcvf \ +/backup/rancher-data-backup-.tar.gz /var/lib/rancher + ``` -3. Restart Rancher Server. Replace `` with the ID of your Rancher container. +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. - ```bash + ``` +# Restart Rancher server docker start ``` diff --git a/content/rancher/v2.x/en/backups/restorations/single-node-restoration/_index.md b/content/rancher/v2.x/en/backups/restorations/single-node-restoration/_index.md index b00b43f9bf2..2b057b1384f 100644 --- a/content/rancher/v2.x/en/backups/restorations/single-node-restoration/_index.md +++ b/content/rancher/v2.x/en/backups/restorations/single-node-restoration/_index.md @@ -6,23 +6,26 @@ aliases: - /rancher/v2.x/en/installation/after-installation/single-node-backup-and-restoration/ --- -Backup to a restoration point for your Rancher install if you encounter issues when upgrading. +Restoring to a backup for your Rancher install if you encounter issues in your Rancher setup. 1. Stop the container currently running Rancher Server. Replace `` with the ID of your Rancher container. - ```bash + ``` docker stop ``` -2. Go to the location where you saved your backup tar balls. And run the following command: -```bash -docker run --volumes-from -v $PWD:/backup alpine sh -c "rm /var/lib/rancher/* -rf && tar zxvf /backup/.tar.gz" -``` +2. Go to the location where you saved your [backup tar balls]({{< baseurl >}}/rancher/v2.x/en/backups/backups/single-node-backups/#backup). Run the following command to delete your current state data and start your backup data: ->**Warning!** Running this command will delete ALL current state data from your Rancher Server container. Any changes that happened after the backup point you are restoring will be lost. + ``` +docker run --volumes-from -v $PWD:/backup \ +alpine sh -c "rm /var/lib/rancher/* -rf && \ +tar zxvf /backup/.tar.gz" + ``` + + >**Warning!** Running this command will delete ALL current state data from your Rancher Server container. Any changes that happened after the backup point you are restoring will be lost. 3. Start you rancher server container back. The container will start with the data from the restored backup. - ```bash + ``` docker start ``` diff --git a/content/rancher/v2.x/en/backups/rollbacks/single-node-rollbacks/_index.md b/content/rancher/v2.x/en/backups/rollbacks/single-node-rollbacks/_index.md index 15db8e2b01b..698bd9ea667 100644 --- a/content/rancher/v2.x/en/backups/rollbacks/single-node-rollbacks/_index.md +++ b/content/rancher/v2.x/en/backups/rollbacks/single-node-rollbacks/_index.md @@ -16,19 +16,21 @@ docker pull rancher/rancher: 2. Stop the container currently running Rancher Server. Replace `` with the ID of your Rancher container. - ```bash + ``` docker stop ``` -3. Go to the location where you saved your backup tar balls. And run the following command. +3. Go to the location where you saved your [backup tar balls]({{< baseurl>}}/rancher/v2.x/en/upgrades/single-node-upgrade/#backup). Run the following command to create a data container from the backup tar ball. -```bash -docker run --volumes-from rancher-data- -v $PWD:/backup alpine sh -c "rm /var/lib/rancher/* -rf && tar zxvf /backup/.tar.gz" -``` + ``` +docker run --volumes-from rancher-data- \ + -v $PWD:/backup alpine sh -c "rm /var/lib/rancher/* -rf \ + && tar zxvf /backup/.tar.gz" + ``` -4. Start a new Rancher Server container with the `` tag. +4. Start a new Rancher Server container with the `` tag pointing to the data container. ``` -docker run -d --volumes-from rancher-data- --restart=unless-stopped \ --p 80:80 -p 443:443 rancher/rancher: +docker run -d --volumes-from rancher-data- \ + --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher: ``` >**Note:** _Do not_ stop the rollback after initiating it, even if the rollback process seems longer than expected. Stopping the rollback may result in database issues during future upgrades. diff --git a/content/rancher/v2.x/en/upgrades/single-node-upgrade/_index.md b/content/rancher/v2.x/en/upgrades/single-node-upgrade/_index.md index 9889727cd61..f0631f3b1b6 100644 --- a/content/rancher/v2.x/en/upgrades/single-node-upgrade/_index.md +++ b/content/rancher/v2.x/en/upgrades/single-node-upgrade/_index.md @@ -25,15 +25,14 @@ docker create --volumes-from \ --name rancher-data rancher/rancher: ``` -1. Create another container of your current Rancher data. However, this container is a backup for restoring your Rancher Server if your upgrade is unsuccessful. Name the container `rancher-data-snapshot-`. +1. Create a backup tar ball of your current Rancher data. If you need to rollback, use this backup tar ball. - - Replace `` with the same ID from the previous step. - - Replace `` with the tag for the version of Rancher currently installed. - - Replace `` with the version of Rancher that you are currently running, as mentioned in the [prerequisite](#prereq). + - Replace `` with the tag for the version of Rancher currently installed. ``` -docker create --volumes-from \ ---name rancher-data-snapshot- rancher/rancher: +docker run --volumes-from rancher-data -v $PWD:/backup \ +alpine tar zcvf /backup/rancher-data-backup-.tar.gz \ +/var/lib/rancher ``` 1. Pull the most recent image of Rancher.