Upgrading OppiaMobile Server

To ensure you get all the latest features, bug fixes and patches, it’s important to keep your OppiaMobile server up to date.

The upgrade process is described below, with the paths/directories described as OppiaMobile server is set up on the AWS image. If you have installed OppiaMobile server to different location, then amend the paths/directories as required. Or, if you have your own clone of the OppiaMobile server code, you will need to merge the core version into your clone and resolve any conflicts, before updating your server.

Your server must be connected to the internet for the upgrade process.

Backup

Ensure you have a backup of your OppiaMobile database, code and any uploaded files/courses

Pull the latest updates from the core version

  1. Move to the django-oppia directory: $ cd /home/oppiamobile/django-oppia/

  2. Pull the latest updates: $ sudo git pull

Update to a specific version number

If you prefer to upgrade to a more recent version, but not necessarily the absolute latest, you can upgrade to a specific version:

  1. Move to the django-oppia directory: $ cd /home/oppiamobile/django-oppia/

  2. Checkout the specific version (in this instance 0.14.2): $ sudo git checkout v0.14.2-release

Note

Each server release is tagged in the format vX.Y.Z-release, so you can specify which version you’d like to upgrade to.

Warning

It is strongly advised that you do not try to downgrade as you will likely run into inconsistencies in the database, both data and structure, that can be very difficult to resolve.

Activate the VirtualEnv

  1. Move to Oppia directory: $ cd /home/oppiamobile

  2. Activate virtual environment: $ source env/bin/activate

You will see the prefix (env) at the beginning of your command line. Once the upgrade is complete you can de-activate the virtual environment using (env)$ deactivate.

Check for any updated/new required packages

  1. Check and install: (env)$ pip install -r django-oppia/requirements.txt

Any updated or new packages will now be installed

Migrate the database

  1. Migrate database with: (env)$ python django-oppia/manage.py migrate

Copy static files

  1. Copy static files with: (env)$ python manage.py collectstatic

Run update_summaries –fromstart

This isn’t necessary for every release unless specified. But if you are skipping quite a few inbetween releases (e.g. from 0.12.2 to 0.13.3), then it’s best to run this.

  1. Run the update summaries command from start: (env)$ python manage.py update_summaries --fromstart

  2. This might take a long time (hours) for large implementations, see Running Update Summaries in background

Restart Apache

  1. Restart Apache server: $ sudo service apache2 restart

Additional Updates

Some releases may have some additional specific upgrade steps. Releases (from 0.12.0 onwards) that have additional steps are noted below.