Upgrading to OppiaMobile Server v0.12.0

OppiaMobile v0.12.0 has moved to using Python 3 and Django 2, so you will need to update the versions of Python and Django that you are using. The migration steps are described below, running the commands from the root of your OppiaMobile server installation (eg /home/oppia/).

Update Virtual Environment

  1. Remove the existing virtualenv: $ sudo rm -R env

  2. Create a new virtualenv: $ virtualenv -p /usr/bin/python3 env

  3. Activate the new virtualenv: $ source env/bin/activate

Note

If you get an error at step 2 (eg virtualenv is not compatible with this system or executable), you may need to update virtualenv first (with pip install --upgrade virtualenv)

Update MySQL connectors

The MySQL connector libraries in Python 3 have been changed:

  1. Run: $ sudo apt-get install python3-mysqldb python3-dev libpython3-dev

  2. Run: (env)$ pip install mysqlclient

Update Pillow dependencies

The new version of Oppia uses an updated version of Pillow, so you may need to update the Pillow dependencies to ensure the new version installs correctly:

  1. Run: $ sudo apt-get install libjpeg-dev zlib1g-dev

Add required Oppia packages

Since we have removed the old virtualenv, we need to re-install, and at the same time, update the required packages:

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

Update database

  1. Run: (env)$ python manage.py migrate

Note

If you get a message about stale .pyc files, then run find . -name "*.pyc" -type f -delete. But use this carefully and make sure you only run it from the django-oppia directory.

Update static files

  1. Run: (env)$ python manage.py compilescss - don’t worry about the unclosed files warning messages

  2. Run: (env)$ python manage.py collectstatic

For live servers using mod_wsgi on Apache webserver

If you are using Apache as the webserver, then you will need to update the version of mod_wsgi:

  1. Run sudo apt-get install libapache2-mod-wsgi-py3

Also update the path in the apache config file to the python site packages