|
| 1 | +# Patchwork Upgrade Guide |
| 2 | + |
| 3 | +## 0.9.0 to 1.0.0 |
| 4 | + |
| 5 | +Version 1.0.0 changes a few admin-visible components of patchwork so |
| 6 | +upgrading involves a few steps. |
| 7 | + |
| 8 | +### Database Migrations |
| 9 | + |
| 10 | +Update the database schema, by running the `015-add-patch-tags.sql` script, |
| 11 | +and re-run the grants script. For example, on postgres: |
| 12 | + |
| 13 | + psql -f lib/sql/migration/015-add-patch-tags.sql patchwork |
| 14 | + psql -f lib/sql/grant-all.postgres.sql patchwork |
| 15 | + |
| 16 | +### Update to the new settings infrastructure |
| 17 | + |
| 18 | +By default, settings are read from `patchwork/settings/production.py`. To |
| 19 | +migrate, use the template: |
| 20 | + |
| 21 | + cp patchwork/settings/production{.example,}.py |
| 22 | + |
| 23 | +Merge your previous settings (from `apps/local_settings.py`) into this file. |
| 24 | + |
| 25 | +### Fixup external references to `apps/` |
| 26 | + |
| 27 | +The `apps/` directory is gone; the patchwork module is now in the top-level |
| 28 | +directory. If you have scripts that run anything from `apps/` (e.g. incoming |
| 29 | +mail parsers that call `parsemail.sh`, and cron scripts), then remove the |
| 30 | +`apps/` directory from those: |
| 31 | + |
| 32 | + apps/patchwork/ -> patchwork/ |
| 33 | + |
| 34 | +Alternatively, you can create a symlink - `apps/ -> .` |
| 35 | + |
| 36 | +If you have been running scripts (eg, from cron) that set the |
| 37 | +`DJANGO_SETTINGS_MODULE` environment variable, you'll need to update that to |
| 38 | +the new settings system. Typically: |
| 39 | + |
| 40 | + DJANGO_SETTINGS_MODULE=patchwork.settings.production |
| 41 | + |
| 42 | +The `manage.py` script has been moved from apps/ into the top-level directory |
| 43 | +too. |
| 44 | + |
| 45 | +### Migrate to the `staticfiles` module |
| 46 | + |
| 47 | +Static content should now be located in the folder indicated by `STATIC_ROOT`. |
| 48 | +This should point somewhere sensible (e.g. the absolute path of `htdocs/static` |
| 49 | +in the patchwork tree). |
| 50 | + |
| 51 | +You'll need to set the `STATIC_ROOT` setting in your settings file. |
| 52 | + |
| 53 | +Once settings are configured, run the 'collectstatic' management command: |
| 54 | + |
| 55 | + ./manage.py collectstatic |
| 56 | + |
| 57 | +You also need to update your Apache configuration to use the new static |
| 58 | +content. Since static content is now in all under `STATIC_ROOT`, the |
| 59 | +configuration should be simpler than in previous releases. The core config |
| 60 | +will be: |
| 61 | + |
| 62 | + DocumentRoot /srv/patchwork/htdocs/ |
| 63 | + Alias /static/ /srv/patchwork/htdocs/static/ |
| 64 | + WSGIScriptAlias / /srv/pathchwork/lib/apache2/patchwork.wsgi |
| 65 | + WSGIPassAuthorization On |
| 66 | + |
| 67 | +### Use new management console |
| 68 | + |
| 69 | +The patchwork cron script (`bin/patchwork-cron.py`) has been moved to a |
| 70 | +`manage.py` command. Instead of running `patchwork-cron.py`, you should now |
| 71 | +run: |
| 72 | + |
| 73 | + ./manage.py cron |
| 74 | + |
0 commit comments