summaryrefslogtreecommitdiff
path: root/UPGRADING.md
blob: 35c75e5c8e1317f2c68eb633971709d39345579d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Patchwork Upgrade Guide

## 1.0.0 to 1.1.0

Version 1.1.0 adds a number of new features, but many of these will require
little to no changes.

## 0.9.0 to 1.0.0

Version 1.0.0 changes a few admin-visible components of Patchwork so
upgrading involves a few steps.

### Database Migrations

Update the database schema, by running the `015-add-patch-tags.sql` script,
and re-run the grants script. For example, on postgres:

    psql -f lib/sql/migration/015-add-patch-tags.sql patchwork
    psql -f lib/sql/grant-all.postgres.sql patchwork

We highly suggest you move to Django Migrations as support for Django 1.6
(and subsequently manual SQL migrations) will be dropped in an upcoming
release. You can do this using the migrate command:

    ./manage.py migrate --fake-initial

**NOTE**: The `--fake-initial` parameter is only required on Django >= 1.8.

### Update to the new settings infrastructure

By default, settings are read from `patchwork/settings/production.py`. To
migrate, use the template:

    cp patchwork/settings/production{.example,}.py

Merge your previous settings (from `apps/local_settings.py`) into this file.

### Fixup external references to `apps/`

The `apps/` directory is gone; the Patchwork module is now in the top-level
directory. If you have scripts that run anything from `apps/` (e.g. incoming
mail parsers that call `parsemail.sh`, and cron scripts), then remove the
`apps/` directory from those:

    apps/patchwork/ -> patchwork/

Alternatively, you can create a symlink - `apps/ -> .`

If you have been running scripts (eg, from cron) that set the
`DJANGO_SETTINGS_MODULE` environment variable, you'll need to update that to
the new settings system. Typically:

    DJANGO_SETTINGS_MODULE=patchwork.settings.production

The `manage.py` script has been moved from apps/ into the top-level directory
too.

### Migrate to the `staticfiles` module

Static content should now be located in the folder indicated by `STATIC_ROOT`.
This should point somewhere sensible (e.g. the absolute path of `htdocs/static`
in the Patchwork tree).

You'll need to set the `STATIC_ROOT` setting in your settings file.

Once settings are configured, run the 'collectstatic' management command:

    ./manage.py collectstatic

You also need to update your Apache configuration to use the new static
content. Since static content is now in all under `STATIC_ROOT`, the
configuration should be simpler than in previous releases. The core config
will be:

    DocumentRoot /srv/patchwork/htdocs/
    Alias /static/ /srv/patchwork/htdocs/static/
    WSGIScriptAlias / /srv/pathchwork/lib/apache2/patchwork.wsgi
    WSGIPassAuthorization On

### Use new management console

The Patchwork cron script (`bin/patchwork-cron.py`) has been moved to a
`manage.py` command. Instead of running `patchwork-cron.py`, you should now
run:

    ./manage.py cron