From 00ca91a06ac92bd575ada55d9024dcef52a9f052 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 6 Dec 2024 12:07:51 +0100 Subject: [PATCH] Replace database with new database version --- migrate.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/migrate.sh b/migrate.sh index 2acd0cc..4075d2d 100644 --- a/migrate.sh +++ b/migrate.sh @@ -28,4 +28,11 @@ mkdir "$NEW_DB_PATH" cd /tmp /postgres/17/bin/pg_upgrade -b /postgres/16/bin/ -d "$OLD_DB_PATH" -D "$NEW_DB_PATH" -U "$POSTGRES_USER" || exit 2 -# TODO: replace database \ No newline at end of file + +# Replace database +echo "Replace database files..." +rm -rf "$DB_PATH"/* +cp -r "$NEW_DB_PATH"/* "$DB_PATH" +mv "$OLD_DB_PATH" "$DB_PATH" + +echo "Done with migration." \ No newline at end of file