From f8c43f90e5a55f8e5832fbff4839559906658cbd Mon Sep 17 00:00:00 2001 From: moelsayed Date: Wed, 25 Jul 2018 23:18:41 +0200 Subject: [PATCH] Update backup/restore/rollback procedure --- .../backups/single-node-backups/_index.md | 21 ++++++++++------ .../single-node-restoration/_index.md | 18 +++++++------ .../rollbacks/single-node-rollbacks/_index.md | 25 ++++++++++++------- 3 files changed, 41 insertions(+), 23 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 b5de34092ee..4cedc3498eb 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 @@ -3,7 +3,7 @@ title: Creating Backups—Single Node Installs weight: 25 aliases: - /rancher/v2.x/en/installation/after-installation/single-node-backup-and-restoration/ - - /rancher/v2.x/en/installation/backups-and-restoration/single-node-backup-and-restoration/ + - /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. @@ -12,26 +12,33 @@ After completing your single node installation of Rancher create a backup of you 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 backup container. This container backs up the data from your current Rancher Server, which you can use as a recovery point. +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. - 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-backup- rancher/rancher: +--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. Restart Rancher Server. Replace `` with the ID of your Rancher container. - ``` + ```bash 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). \ No newline at end of file +**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). 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 6cc8c8359ca..b00b43f9bf2 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 @@ -10,15 +10,19 @@ Backup to a restoration point for your Rancher install if you encounter issues w 1. Stop the container currently running Rancher Server. Replace `` with the ID of your Rancher container. - ``` + ```bash docker stop ``` -1. Launch a new Rancher Server container using the most recent `rancher-backup-` container that you backed up. - - For more information on obtaining this container name, see [Creating Backups—Single Node Installs](/Users/markbishop/Documents/GitHub/docs/content/rancher/v2.x/en/upgrades/backups/single-node-backups/#backup). +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" +``` - ``` -docker run -d --volumes-from rancher-backup- --restart=unless-stopped \ --p 80:80 -p 443:443 rancher/rancher: +>**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 e81262c41c8..15db8e2b01b 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 @@ -3,10 +3,8 @@ title: Rolling Back—Single Node Installs weight: 25 --- -Rolling back an unsuccessful Rancher upgrade requires you to run the upgrade command again, with a couple of modifications: - -- Run the upgrade command using the server tag for your prior Rancher install. -- Run the upgrade command while pointing toward the backup container you created while completing [Single Node Upgrade]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrade-scenarios/single-node-upgrade/). +Rolling back an unsuccessful Rancher upgrade requires you to +restore the backup you created while completing [Single Node Upgrade]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrade-scenarios/single-node-upgrade/). >**Warning!** Rolling back to a previous version of Rancher destroys any changes made to Rancher following the upgrade. Unrecoverable data loss may occur. @@ -16,12 +14,21 @@ Rolling back an unsuccessful Rancher upgrade requires you to run the upgrade com docker pull rancher/rancher: ``` -1. Launch a Rancher Server container that you created while completing [Step 3 of Single Node Upgrade]({{< baseurl >}}/rancher/v2.x/en/upgrades/upgrade-scenarios/single-node-upgrade/#backup). - - Replace the `` placeholders with the version number of Rancher that you're rolling back to before upgrade. +2. Stop the container currently running Rancher Server. Replace `` with the ID of your Rancher container. + ```bash +docker stop ``` -docker run -d --volumes-from rancher-data-snapshot- --restart=unless-stopped \ + +3. Go to the location where you saved your backup tar balls. And run the following command. + +```bash +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. + ``` +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. \ No newline at end of file + >**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.