@@ -122,12 +122,15 @@ It will no longer output the access log, but will continue to output the event l
122
122
123
123
## Pack the ZODB
124
124
125
+ ``` {versionadded} Plone 6.0.15 and Plone 6.1.1
126
+ ```
127
+
125
128
A common maintenance task of a Plone instance is to [ pack the ZODB] ( https://zodb.org/en/stable/reference/zodb.html#ZODB.DB.pack ) .
126
129
Packing removes old revisions of objects.
127
130
It is similar to [ routine vacuuming in PostgreSQL] ( https://www.postgresql.org/docs/8.3/routine-vacuuming.html ) .
128
131
129
132
The official {doc}` /install/containers/images/backend ` container and project containers based on them have a ` pack ` command to pack the ZODB.
130
- The command will work in standalone mode, ZEO mode, and RelStorage mode but only with PostgreSQL .
133
+ The command will work in standalone mode, ZEO mode, and with PostgreSQL only in RelStorage mode .
131
134
132
135
Invoke the command in a running container by passing in the appropriate command for the mode.
133
136
@@ -146,7 +149,16 @@ docker run -e ZEO_ADDRESS=zeo:8100 --link zeo plone/plone-backend pack
146
149
In RelStorage mode, pass the connection DSN.
147
150
148
151
``` shell
149
- docker run -e RELSTORAGE_DSN=" dbname='plone' user='plone' host='db' password='password' port='5432'" pack
152
+ docker run -e RELSTORAGE_DSN=" dbname='plone' user='plone' host='db' password='password' port='5432'" plone/plone-backend pack
153
+ ```
154
+
155
+ In Docker Swarm, if the database is only available on an internal network, it's required to specify the network.
156
+ For this situation, it might be easier to use ` docker exec ` to run the pack command in an existing ` plone-backend ` container.
157
+ The following command assumes that the service that runs the Plone instance is named ` backend ` .
158
+ Replace ` backend ` with your container's name.
159
+
160
+ ``` shell
161
+ docker exec RELSTORAGE_DSN=" dbname='plone' user='plone' host='db' password='password' port='5432' network='internal" backend pack
150
162
```
151
163
152
164
In running containers that use Docker Compose, the command is less complicated.
0 commit comments