Upgrade Weblate from git 2.18 version to latest docker

MAKE A BACKUP FIRST.
Ensure the website runs well before upgrading.

If encountering error ImproperlyConfigured: Requested setting DATA_DIR, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. when starting server, run export DJANGO_SETTINGS_MODULE=weblate.settings.

Read Generic upgrade instructions from official weblate doc first.

Special instruction for my build: Custom changes to weblate (weblate/trans/formats.py)and translate-toolkit (translate/storage/properties.py)to provide a special “Minecraft Lang File” format. The HTTP server is Gunicorn with Nginx. The operating system is Ubuntu 16.04 and weblate runs on Python 2.7. The database is PostgreSQL 9.5. These softwares will be upgraded or replaced during progress.

Universal step:

Run git fetch --all before git operation to ensure latest code exists.

  1. Read Version specific instructions and follow it.
  2. Stop gunicorn/wsgi and celery worker.
  3. git stash (before 3.0.x)
  4. git reset --hard (before 3.0.x)
  5. git checkout weblate-x.x Usex.x.1 or the latest minor version if it exists for a major version.
  6. git stash pop (before 3.0.x)
  7. pip install -r requirements.txt
  8. find weblate -name '*.pyc' -delete to remove cached compiled bytecode.
  9. Update settings.py to accommodate to settings_example.py.
  10. python manage.py migrate --noinput
  11. follow other manage commands in generic upgrade instructions.
  12. Start the server and check if everything works well.
Continue reading Upgrade Weblate from git 2.18 version to latest docker