Skip to content

Commit e065ed6

Browse files
committed
UPGRADING: Re-wrap.
1 parent bb9ff67 commit e065ed6

File tree

1 file changed

+58
-62
lines changed

1 file changed

+58
-62
lines changed

UPGRADING.md

Lines changed: 58 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
## Upgrading the Zulip container
22

3-
You can upgrade your Zulip installation to any newer version of Zulip
4-
with the following instructions. At a high level, the strategy is to
5-
download a new image, stop the `zulip` container, and then boot it
6-
back up with the new image. When the upgraded `zulip` container boots
7-
the first time, it will run the necessary database migrations with
8-
`manage.py migrate`.
9-
10-
If you ever find you need to downgrade your Zulip server, you'll need
11-
to use `manage.py migrate` to downgrade the database schema manually.
12-
13-
If you are using old `galexrt/docker-zulip` images (from Zulip 1.8.1 or
14-
older), you need to upgrade the postgres image from
3+
You can upgrade your Zulip installation to any newer version of Zulip with the
4+
following instructions. At a high level, the strategy is to download a new
5+
image, stop the `zulip` container, and then boot it back up with the new
6+
image. When the upgraded `zulip` container boots the first time, it will run the
7+
necessary database migrations with `manage.py migrate`.
8+
9+
If you ever find you need to downgrade your Zulip server, you'll need to use
10+
`manage.py migrate` to downgrade the database schema manually.
11+
12+
If you are using old `galexrt/docker-zulip` images (from Zulip 1.8.1 or older),
13+
you need to upgrade the postgres image from
1514
`quay.io/galexrt/postgres-zulip-tsearchextras:latest`. Refer to the
16-
[instructions for upgrading from the old galexrt/docker-zulip](#upgrading-from-the-old-galexrtdocker-zulip)
17-
section.
15+
[instructions for upgrading from the old
16+
galexrt/docker-zulip](#upgrading-from-the-old-galexrtdocker-zulip) section.
1817

1918
### Using `docker-compose`
2019

21-
0. (Optional) Upgrading does not delete your data, but it's generally
22-
good practice to
23-
[back up your Zulip data](http://zulip.readthedocs.io/en/latest/prod-maintain-secure-upgrade.html#backups)
24-
before upgrading to make switching back to the old version
25-
simple. You can find your docker data volumes by looking at the
26-
`volumes` lines in `docker-compose.yml`
27-
e.g. `/opt/docker/zulip/postgresql/data/`.
20+
0. (Optional) Upgrading does not delete your data, but it's generally good
21+
practice to [back up your Zulip
22+
data](http://zulip.readthedocs.io/en/latest/prod-maintain-secure-upgrade.html#backups)
23+
before upgrading to make switching back to the old version simple. You can
24+
find your docker data volumes by looking at the `volumes` lines in
25+
`docker-compose.yml` e.g. `/opt/docker/zulip/postgresql/data/`.
2826

2927
Note that `docker-zulip` did not support for Zulip's built-in
3028
`restore-backup` tool before Zulip 3.0.
@@ -38,22 +36,21 @@ section.
3836
We recommend always upgrading to the latest minor release within a major
3937
release series.
4038

41-
2. Update this project to the corresponding `docker-zulip` version and
42-
resolve any merge conflicts in `docker-compose.yml`.
43-
This is important as new Zulip releases may require additional
44-
settings to be specified in `docker-compose.yml`
45-
(E.g. authentication settings for `memcached` became mandatory in
46-
the `2.1.2` release).
39+
2. Update this project to the corresponding `docker-zulip` version and resolve
40+
any merge conflicts in `docker-compose.yml`. This is important as new Zulip
41+
releases may require additional settings to be specified in
42+
`docker-compose.yml` (E.g. authentication settings for `memcached` became
43+
mandatory in the `2.1.2` release).
4744

48-
**Note:** Do not make any changes to the database version or
49-
volume. If there is a difference in database version, leave those
50-
unchanged for now, and complete that upgrade separately after the
51-
Zulip upgrade; see [the section below][pg-upgrade].
45+
**Note:** Do not make any changes to the database version or volume. If there
46+
is a difference in database version, leave those unchanged for now, and
47+
complete that upgrade separately after the Zulip upgrade; see [the section
48+
below][pg-upgrade].
5249

5350
[pg-upgrade]: #upgrading-zulipzulip-postgresql-to-14
5451

55-
3. Verify that your updated `docker-compose.yml` points to the desired image version,
56-
e.g.:
52+
3. Verify that your updated `docker-compose.yml` points to the desired image
53+
version, e.g.:
5754

5855
```yaml
5956
zulip:
@@ -80,9 +77,8 @@ docker-compose exec -u zulip zulip cat /home/zulip/deployments/current/version.p
8077

8178
### Upgrading from a Git repository
8279

83-
1. Edit `docker-compose.yml` to comment out the `image` line, and
84-
specify the Git commit you'd like to build the zulip container from.
85-
E.g.:
80+
1. Edit `docker-compose.yml` to comment out the `image` line, and specify the
81+
Git commit you'd like to build the zulip container from. E.g.:
8682

8783
```yaml
8884
zulip:
@@ -99,44 +95,44 @@ docker-compose exec -u zulip zulip cat /home/zulip/deployments/current/version.p
9995
and `ZULIP_GIT_REF` to be any ref name in that repository (e.g. `master` or
10096
`1.9.0` or `445932cc8613c77ced023125248c8b966b3b7528`).
10197

102-
2. Run `docker-compose build zulip` to build a Zulip Docker image from
103-
the specified Git version.
98+
2. Run `docker-compose build zulip` to build a Zulip Docker image from the
99+
specified Git version.
104100

105101
Then stop and restart the container as described in the previous section.
106102

107103
### Upgrading zulip/zulip-postgresql to 14
108104

109-
The Docker Compose configuration for version 6.0-0 and higher default
110-
to using PostgreSQL 14, as the previously-used PostgreSQL 10 is no
111-
longer supported. Because the data is specific to the version of
112-
PostgreSQL which is running, it must be dumped and re-loaded into a
113-
new volume to upgrade. PostgreSQL 14 will refuse to start if provided
114-
with un-migrated data from PostgreSQL 10.
105+
The Docker Compose configuration for version 6.0-0 and higher default to using
106+
PostgreSQL 14, as the previously-used PostgreSQL 10 is no longer
107+
supported. Because the data is specific to the version of PostgreSQL which is
108+
running, it must be dumped and re-loaded into a new volume to
109+
upgrade. PostgreSQL 14 will refuse to start if provided with un-migrated data
110+
from PostgreSQL 10.
115111

116112
The provided `upgrade-postgresql` tool will dump the contents of the
117-
`postgresql` image's volume, create a new PostgreSQL 14 volume,
118-
perform the necessary migration, update the `docker-compose.yml`
119-
file to match, and re-start Zulip.
113+
`postgresql` image's volume, create a new PostgreSQL 14 volume, perform the
114+
necessary migration, update the `docker-compose.yml` file to match, and re-start
115+
Zulip.
120116

121117
### Upgrading from the old galexrt/docker-zulip
122118

123-
If you are using an earlier version of `galexrt/docker-zulip` which
124-
used the `quay.io/galexrt/postgres-zulip-tsearchextras:latest`
125-
PostgreSQL image, you need to run a few manual steps to upgrade to the
126-
`zulip/zulip-postgresql` PostgreSQL image (because we've significantly
127-
upgraded the major postgres version).
119+
If you are using an earlier version of `galexrt/docker-zulip` which used the
120+
`quay.io/galexrt/postgres-zulip-tsearchextras:latest` PostgreSQL image, you need
121+
to run a few manual steps to upgrade to the `zulip/zulip-postgresql` PostgreSQL
122+
image (because we've significantly upgraded the major postgres version).
128123

129-
These instructions assume that you have not changed the default
130-
PostgreSQL data path (`/opt/docker/zulip/postgresql/data`) in your
131-
`docker-compose.yml`. If you have changed it, please replace all
132-
occurences of `/opt/docker/zulip/postgresql/data` with your path.
124+
These instructions assume that you have not changed the default PostgreSQL data
125+
path (`/opt/docker/zulip/postgresql/data`) in your `docker-compose.yml`. If you
126+
have changed it, please replace all occurences of
127+
`/opt/docker/zulip/postgresql/data` with your path.
133128

134129
1. Make a backup of your Zulip PostgreSQL data dir.
135130

136-
2. Stop all Zulip containers, except the postgres one (e.g. use
137-
`docker stop` and not `docker-compose stop`).
131+
2. Stop all Zulip containers, except the postgres one (e.g. use `docker stop`
132+
and not `docker-compose stop`).
138133

139-
3. Create a new (upgraded) PostgreSQL container using a different data directory:
134+
3. Create a new (upgraded) PostgreSQL container using a different data
135+
directory:
140136

141137
```shell
142138
docker run -d \
@@ -163,9 +159,9 @@ occurences of `/opt/docker/zulip/postgresql/data` with your path.
163159
docker rm --stop postgresnew
164160
```
165161

166-
6. Edit your `docker-compose.yml` to use the
167-
`zulip/zulip-postgresql:latest` image for the `database` container
168-
(this is the default in `zulip/docker-zulip`).
162+
6. Edit your `docker-compose.yml` to use the `zulip/zulip-postgresql:latest`
163+
image for the `database` container (this is the default in
164+
`zulip/docker-zulip`).
169165

170166
7. Replace the old PostgreSQL data directory with upgraded data directory:
171167

0 commit comments

Comments
 (0)