WIP
This commit is contained in:
28
migrate.sh
Normal file
28
migrate.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
echo Migrate PostgreSQL version
|
||||
|
||||
DB_PATH=/db
|
||||
OLD_DB_PATH=/tmp/old_db
|
||||
|
||||
# Run database on a COPY of the database
|
||||
cp -r "$DB_PATH" "$OLD_DB_PATH"
|
||||
|
||||
# Start the database in the background
|
||||
/postgres/16/bin/postgres -D /tmp/old_db/ &
|
||||
|
||||
while true;
|
||||
do
|
||||
echo Waiting for database...
|
||||
if echo "\q" | /postgres/16/bin/psql -U "$POSTGRES_USER";
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Perform dump
|
||||
|
||||
|
||||
# Stop database
|
||||
#pkill postgres
|
||||
|
||||
bash
|
Reference in New Issue
Block a user