elsirion / fedimint-observer

Fedimint Federation Explorer
https://observer.fedimint.org
10 stars 11 forks source link

chore: add backup and restore scripts and just aliases #31

Closed bradleystachurski closed 1 month ago

bradleystachurski commented 1 month ago

Using a simple plaintext (sql) dump format instead of custom, directory, or tar formats. Happy to switch the format if we'd prefer a different one.

nix@1235afff2e46:~/fedimint-observer$ just pg_backup
./scripts/pg_dev/backup.sh
nix@1235afff2e46:~/fedimint-observer$ just pg_stop && rm -rf .pg_dev/ && just pg_start
...
nix@1235afff2e46:~/fedimint-observer$ just pg_restore 2024-08-10_2307_backup.sql
./scripts/pg_dev/restore.sh 2024-08-10_2307_backup.sql
No relations found in postgres db, restoring

real    0m32.478s
user    0m0.545s
sys     0m0.613s
Restore complete
elsirion commented 1 month ago

Let's create a directory for these backups and include it in .gitignore.

bradleystachurski commented 1 month ago

Let's create a directory for these backups and include it in .gitignore.

Good call 👍