Skip to content

Upgrading

Esteban C Borsani edited this page Sep 18, 2020 · 31 revisions

Upgrading

Do not skip minor versions! If you are on Spirit v0.1, upgrade to v0.2, then to v0.3, and then to v0.4. You may skip patch versions. Check the changelog for more information about what changed from one version to the next one.

From v0.4.x to v0.4.x+ (patch versions)

Warning!
Make a database backup before upgrading to avoid data loss, you have been warned. Use the pg_dump command on PostgreSQL or mysqldump on MySQL. You can also create a backup running python manage.py dumpdata --indent=4 > database.json.
You may want to backup your media folder too.

1. Install:

You can either clone the repository or install it via PIP.

Option 1, PIP:

$ pip install -I django-spirit==0.4.x  # replace the x by the latest patch version

Option 2, Clone:

$ git clone https://github.com/nitely/Spirit.git  # if already cloned skip this
$ cd Spirit
$ git fetch
$ git checkout origin/v0.4.x
$ git reset --hard origin/v0.4.x
$ pip install -r requirements.txt  # update the dependencies

2. Migration:

$ python manage.py migrate
$ python manage.py collectstatic
$ python manage.py rebuild_index --noinput  # rebuild the search engine index
$ python manage.py createcachetable

3. Run the server & test!

Start up Spirit and test everything is ok.

From v0.3.0 to v0.4.x

Warning!
Make a database backup before upgrading to avoid data loss, you have been warned. Use the pg_dump command on PostgreSQL or mysqldump on MySQL. You can also create a backup running python manage.py dumpdata --indent=4 > database.json.
You may want to backup your media folder too.

.

Note
You won't be able to upgrade from 0.2 to 0.4, you will have to upgrade to 0.3 first and then upgrade to 0.4+.

1. Required code changes:

  • Change AUTH_USER_MODEL = 'spirit.User' to AUTH_USER_MODEL = 'spirit_user.User' in settings.py (or your local settings). Skip this if you installed Spirit from the experimental branch.

2. Install:

You can either clone the repository or install it via PIP.

Option 1, PIP:

$ pip install -I django-spirit==0.4.x  # replace the x by the latest patch version

Option 2, Clone:

$ git clone https://github.com/nitely/Spirit.git  # if already cloned skip this
$ cd Spirit
$ git fetch
$ git checkout origin/v0.4.x
$ git reset --hard origin/v0.4.x
$ pip install -r requirements.txt  # update the dependencies

3. Migration:

$ python manage.py migrate --fake-initial
$ python manage.py collectstatic
$ python manage.py rebuild_index --noinput  # rebuild the search engine index

4. Run the server & test!

Start up Spirit and test everything is ok.

From v0.2+ to v0.3

Warning!
Make a database backup before upgrading to avoid data loss, you have been warned. Use the pg_dump command on PostgreSQL or mysqldump on MySQL. You can also create a backup running python manage.py dumpdata --indent=4 > database.json.
You may want to backup your media folder too.

.

Note
The project structure has been heavily changed, this release is just a bridge between the old structure and the new one. You won't be able to upgrade from 0.1 or 0.2 to 0.4, you will have to upgrade to 0.3 first and then upgrade to 0.4+.

1. Required code changes:

Note
This is required if you have actually installed v0.1+. If you have cloned the experimental branch, this is not required, skip it (install and migration steps are required).

  • Add AUTH_USER_MODEL = 'spirit.User' (or your custom user model) to settings.py (or your local settings).
  • If you have your own custom user model, remove the AbstractForumUser from the model inheritance.
  • If you have your own custom user model, change the spirit.models.AbstractUser import to django.contrib.auth.models.AbstractUser.

2. Install:

You can either clone the repository, download it from releases, or install it via PIP.

Option 1, PIP:

$ pip install -I django-spirit==0.3.0

Option 2, Clone:

$ git clone https://github.com/nitely/Spirit.git  # if already cloned skip this
$ cd Spirit
$ git fetch
$ git checkout tags/v0.3.0
$ git reset --hard tags/v0.3.0
$ pip install -r requirements.txt  # update the dependencies

3. Migration:

$ python manage.py migrate --fake-initial
$ python manage.py collectstatic
$ python manage.py rebuild_index --noinput  # rebuild the search engine index

4. Run the server & test!

Start up Spirit and test everything is ok.

From v0.1+ to v0.2.1

Warning!
Make a database backup before upgrading to avoid data loss, you have been warned. Use the pg_dump command on PostgreSQL or mysqldump on MySQL. You can also create a backup running python manage.py dumpdata --indent=4 > database.json.
You may want to backup your media folder too.

1. Required code changes:

  • Change url(r'^', include(urls, namespace="spirit", app_name="spirit")), to url(r'^', include('spirit.urls')), in your urls.py.
  • The way settings used to import your local_settings.py has changed, check out the example provided.

2. Install:

You can either clone the repository, download it from releases, or install it via PIP.

Option 1, PIP:

$ pip install -I django-spirit==0.2.1

Option 2, Clone:

$ git clone https://github.com/nitely/Spirit.git  # if already cloned skip this
$ cd Spirit
$ git fetch
$ git checkout tags/v0.2.1
$ git reset --hard tags/v0.2.1
$ pip install -r requirements.txt  # update the dependencies

3. Migration:

$ python manage.py migrate --fake-initial
$ python manage.py collectstatic
$ python manage.py rebuild_index --noinput  # rebuild the search engine index

4. Run the server & test!

Start up Spirit and test everything is ok.