forked from rDrama/rDrama
sneed
parent
eb049a627c
commit
4dc10e0f99
|
@ -0,0 +1 @@
|
||||||
|
psql "$RECOVERY_DATABASE_URL"
|
|
@ -1,17 +1,19 @@
|
||||||
change recovery_target_time in /etc/postgresql/15/main/postgresql.conf like this
|
change recovery_target_time in /var/lib/postgresql/15/new/postgresql.auto.conf like this
|
||||||
recovery_target_time = '2023-08-12 06:07:00'
|
recovery_target_time = '2023-09-07 3:18:24'
|
||||||
|
|
||||||
systemctl stop postgresql@15-main
|
systemctl stop postgresql@15-new
|
||||||
mv /var/lib/postgresql/15/main/pg_wal /pg_wal
|
|
||||||
rm -rf /var/lib/postgresql/15/main
|
rm -r /var/lib/postgresql/15/new
|
||||||
mkdir /var/lib/postgresql/15/main
|
cp -ar /database_backup/. /var/lib/postgresql/15/new
|
||||||
cp -a /database_backup/. /var/lib/postgresql/15/main
|
chmod 700 /var/lib/postgresql/15/new
|
||||||
chown postgres:postgres /var/lib/postgresql/15/main
|
|
||||||
chmod 700 /var/lib/postgresql/15/main
|
rm -r /var/lib/postgresql/15/new/pg_wal
|
||||||
rm -rf /var/lib/postgresql/15/main/pg_wal
|
cp -ar /var/lib/postgresql/15/main/pg_wal/. /var/lib/postgresql/15/new/pg_wal
|
||||||
mv /pg_wal /var/lib/postgresql/15/main/pg_wal
|
|
||||||
touch /var/lib/postgresql/15/main/recovery.signal
|
touch /var/lib/postgresql/15/new/recovery.signal
|
||||||
systemctl start postgresql@15-main
|
systemctl start postgresql@15-new
|
||||||
|
|
||||||
|
psql "${DATABASE_URL/5432/"5433"}"
|
||||||
|
|
||||||
wait after recovery is done then:
|
wait after recovery is done then:
|
||||||
rm /var/lib/postgresql/15/main/recovery.signal
|
rm /var/lib/postgresql/15/new/recovery.signal
|
||||||
|
|
|
@ -2,5 +2,6 @@ cd /staging
|
||||||
git pull
|
git pull
|
||||||
. /e
|
. /e
|
||||||
export SITE="staging.rdrama.net"
|
export SITE="staging.rdrama.net"
|
||||||
|
export DATABASE_URL=RECOVERY_DATABASE_URL
|
||||||
export WORKER_COUNT="1"
|
export WORKER_COUNT="1"
|
||||||
gunicorn files.__main__:app -b 0.0.0.0:5002 -t 0
|
gunicorn files.__main__:app -b 0.0.0.0:5002 -t 0
|
||||||
|
|
Loading…
Reference in New Issue