update versions in docker backup/restore docs

pull/10761/head
Markus Kahl 2 years ago
parent 8117ddec55
commit e94ac46df7
  1. 4
      docs/installation-and-operations/operation/backing-up/README.md
  2. 7
      docs/installation-and-operations/operation/restoring/README.md

@ -62,7 +62,7 @@ sudo mkdir -p /var/lib/openproject/{pgdata,assets}
docker run -d -p 8080:80 --name openproject -e SECRET_KEY_BASE=secret \
-v /var/lib/openproject/pgdata:/var/openproject/pgdata \
-v /var/lib/openproject/assets:/var/openproject/assets \
openproject/community:10
openproject/community:12
```
Then you would need to backup the `/var/lib/openproject` folder (for instance to S3 or FTP server).
@ -82,7 +82,7 @@ This assumes that the database container is called `db_1`. Find out the actual n
If you need a regular dump of the database you can get one using `pg_dump` like this:
```
docker exec -e PGPASSWORD=openproject -it $OP_CONTAINER_NAME pg_dump -U openproject -h localhost -d openproject -x -O > openproject.sql
docker exec -it $OP_CONTAINER_NAME su - postgres -c 'pg_dump -d openproject -x -O' > openproject.sql
```
Where `$OP_CONTAINER_NAME` is the name of your OpenProject container. If you don't know it you can find it using `docker ps | grep openproject`.

@ -160,11 +160,10 @@ mkdir /var/lib/openproject/{pgdata,assets}
Next we need to initialize the database.
```
docker run --rm -v /var/lib/openproject/pgdata:/var/openproject/pgdata -it openproject/community:11
docker run --rm -v /var/lib/openproject/pgdata:/var/openproject/pgdata -it openproject/community:12
```
As soon as you see `CREATE ROLE` and `Migrating to ToV710AggregatedMigrations (10000000000000)`
or lots of `create_table` in the container's output you can kill it by pressing Ctrl + C.
As soon as you see `Database setup finished.` in the container's output you can kill it by pressing Ctrl + C.
It may take a moment to shut down.
This then has initialized the database under `/var/lib/openproject/pgdata` on your docker host.
@ -173,7 +172,7 @@ This then has initialized the database under `/var/lib/openproject/pgdata` on yo
Now we can restore the database. For this we mount the initialized `pgdata` folder using the postgres docker container.
```
docker run --rm -d --name postgres -v /var/lib/openproject/pgdata:/var/lib/postgresql/data postgres:9.6
docker run --rm -d --name postgres -v /var/lib/openproject/pgdata:/var/lib/postgresql/data postgres:13
```
Once the container is ready you can copy your SQL dump onto it and start `psql`.

Loading…
Cancel
Save