generated from NethServer/ns8-kickstart
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(migration): add script to upgrade PostgreSQL from version 13 to 17
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Copyright (C) 2024 Nethesis S.r.l. | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
# upgrade from postgres 13 to 17 | ||
# migration after https://github.com/NethServer/ns8-mattermost/releases/tag/2.1.1 | ||
|
||
set -e | ||
|
||
if podman exec postgres-app psql --version | grep -qE " 13\.[0-9]+"; then | ||
echo "Dumping mattermost postgres database" | ||
podman exec postgres-app pg_dump -U mattuser --format=c mattermost > mattermost.pg_dump | ||
echo "Stopping mattermost" | ||
systemctl stop --user mattermost | ||
echo "Restoring mattermost postgres database" | ||
podman volume rm -f postgres-data | ||
../actions/restore-module/40restore-postgres | ||
else | ||
echo "Postgres version is not 13, we do not need to upgrade" | ||
fi |