Skip to content

Upgrading release versions

Rajesh Rajendran edited this page Feb 21, 2018 · 5 revisions

Prerequisite

  • Release Notes
  • Changelog

Procedure

  • Backup Database schema and data, if it's being changed
  • Stop relevant services
  • Uninstall the applications if required
  • Install the applications if required
  • Restore the Database schema and data

Example Scenario : upgrade from release-1.3 to release-1.4

# this folder is the previous one, while initial installation of release-1.3
cd sunbird_devops
git checkout release-1.4
# Upgrading to release-1.4 from 1.3
# please cd in to upgrade_scripts/ and fill up groupvars and hosts
bash upgrade.sh

Structure

e.g. upgrade.sh

#!/bin/bash

# Taking the backup and uninstalling deprecated apps
ansible-playbook -i upgrade_scripts/inventory/hosts upgrade.yml --tags backup, uninstall

# Provisioning & Deploying release-version, only apps that changed
ansible-playbook -i inventory/hosts provision.yml --tags mysql, nginx

# Restoring previous data
ansible-playbook -i upgrade_scripts/inventory/hosts upgrade.yml --tags restore

folder structure

╰─$ tree upgrade_scripts 
upgrade_scripts
├── inventory
│   └── hosts
├── roles
│   ├── mysql_backup
│   │   ├── defaults
│   │   │   └── main.yml
│   │   ├── files
│   │   ├── handlers
│   │   │   └── main.yml
│   │   ├── meta
│   │   │   └── main.yml
│   │   ├── README.md
│   │   ├── tasks
│   │   │   └── main.yml
│   │   ├── templates
│   │   ├── tests
│   │   │   ├── inventory
│   │   │   └── test.yml
│   │   └── vars
│   │       └── main.yml
│   └── mysql_restore
│       ├── defaults
│       │   └── main.yml
│       ├── files
│       ├── handlers
│       │   └── main.yml
│       ├── meta
│       │   └── main.yml
│       ├── README.md
│       ├── tasks
│       │   └── main.yml
│       ├── templates
│       ├── tests
│       │   ├── inventory
│       │   └── test.yml
│       └── vars
│           └── main.yml
└── upgrade.yml
Clone this wiki locally