Skip to content

Upgrading Unfetter

Alchemist edited this page Nov 15, 2018 · 10 revisions

0.3.6 or Earlier

0.3.6 and before versions of Unfetter leveraged Docker Compose to build Unfetter. This was fine, but really required alot of work to configure Unfetter properly.

Starting with 0.3.7, Unfetter moved to an Ansible build process that works significantly better. We also did a few other things

  • Ansible can be used to configure deployment specific variables used for initial user promotion, UAC integration, etc.
  • Ansible allows us to use an orchestration server to manage the build process to a remote target system. This is the desired deployment case for security and reusability purposes
  • Like the Cloud? Use it
  • Use ansible for all configuration and management of Unfetter including getting backups, upgrades, etc.

Moving from 0.3.6 to 0.3.7 is the most difficult. Our ansible build is using a few different docker concepts such as Docker named Volumes, backup directories that may include secret information, and docker tag versioning.

WARNING: This upgrade assumes you are building a production version of Unfetter and not development.

⚠️ READ THIS BEFORE CONTINUING: Ansible In Unfetter

To move from 0.3.6 to 0.3.7, please perform the following:

  • Install Ansible
  • Install docker-py. Leverage Pipenv in the ansible directory if you would like
  • Take a snapshot of your current environment in case things go wrong
  • Go into the Unfetter directory and get version v0.3.7 from GitHub
git fetch
git pull origin v0.3.7
cd ansible
  • 0.3.6 deployed everything on a local system. It is assumed that you will continue to run locally.
  • Determine what deployment type you are running from the Deployment Types
  • Using the "host_vars/demo.yml" as a guide, create a configuration file that matches your deployment type "dev.yml, prod-uac.yml, prod-demo.yml, prod-legacy-uac.yml, prod-legacy-demo.yml"
  • Update this file with the variables you need to override.
  • Look at hosts.ini file, and verify that your desired deployment type is in the [deployed] group
  • Make a backup of all config and volatile information with the task-backup-vol-container.yml playbook. ⚠️ While Unfetter is still running, use the following command:
ansible-playbook task-backup-vol-container.yml
  • You should get errors for tasks "backup local-settings.json from gateway" and "backup private-config". That is expected. In 0.3.6, those files are in the wrong location and they have to be rebuilt anyways.
  • Evaluate the backup directory, default is ansible/backup, to determine if you have the mongo database, and your certs
  • Copy the backup directory to another location, so that it can't be overwritten.
  • Upgrade to 0.3.7 with the following ansible command
ansible-playbook task-upgrade-0.3.7.yml
  • Move on the upgrading from 0.3.7 to later

Upgrading from 0.3.7 or later

  • Save your backup files to somewhere in case there is a failure
  • Fetch the latest Unfetter
git fetch
git pull origin master
cd ansible

Backup the database while Unfetter is running.

ansible-playbook task-backup-vol-container.yml
  • Run the remaining task-upgrade-..*.yml, in order to bring Unfetter configuration files up to latest version
  • Perform another backup of the database
ansible-playbook task-backup-vol-container.yml
  • Stop Unfetter. The following commands will remove ALL docker containers and images. You may need to delete specific containers
docker stop $(docker ps -a -q)  # Stops all containers
docker rm $(docker ps -a -q)  # deletes all containers
docker rmi -f $(docker images -q) # deletes all images. This is not required, but will clean up space
  • Now, run your new version of Unfetter
ansible-playbook deploy.yml
  • you should be deployed with the latest version