Änderungen von Dokument PostgreSQL
Zuletzt geändert von Sebastian Marsching am 2023/03/22 23:25
Von Version 3.1
bearbeitet von Sebastian Marsching
am 2023/03/22 23:22
am 2023/03/22 23:22
Änderungskommentar:
Es gibt keinen Kommentar für diese Version
Auf Version 6.1
bearbeitet von Sebastian Marsching
am 2023/03/22 23:25
am 2023/03/22 23:25
Änderungskommentar:
Es gibt keinen Kommentar für diese Version
Zusammenfassung
-
Seiteneigenschaften (1 geändert, 0 hinzugefügt, 0 gelöscht)
Details
- Seiteneigenschaften
-
- Inhalt
-
... ... @@ -22,7 +22,7 @@ 22 22 23 23 ```sh 24 24 docker volume create postgresql-data-old 25 -docker run --rm -it -v postgresql-data:/data -v postgresql-data-old:/data-old alpine mv "/data/*"/data-old/25 +docker run --rm -it -v postgresql-data:/data -v postgresql-data-old:/data-old alpine sh -c "mv /data/* /data-old/" 26 26 ``` 27 27 28 28 Now, we replace the PostgreSQL container with a new container using the image for the new PostgreSQL version. How this is done strongly depends on the setup (e.g. when using Salt, this might be as easy as changing the version number in the SLS and applying it). ... ... @@ -30,7 +30,7 @@ 30 30 Once this has been done, the container is running again, but now with the new version and an empty database. We can now start a second container with the old data in order to dump and restore it: 31 31 32 32 ```sh 33 -docker container run --rm -it -v postgresql-data-old:/var/lib/postgresql -data --name postgresql-old postgresql:x.x-alpine33 +docker container run --rm -it -v postgresql-data-old:/var/lib/postgresql/data --name postgresql-old postgres:x.x-alpine 34 34 ``` 35 35 36 36 In this example, `x.x` has to be replaced by the version number of the old PostgreSQL version.