DB Dump Create
Windows
- Open PG Admin
- Right click on the orsanco database and select backup.
- Give the dump file a path and name such as:
C:\Path\to\orsanco\dumps\orsanco_dump_mmddyyyy.backup - Leave all other values as default and click the Backup button.
Linux
This walkthrough assumes you are already connected to the VM CLI.
- Check how many cores your computer has available with the command
lscpu; make note of the "CPU(s)" value. - Create a directory-based dump with the command:
pg_dump --dbname=orsanco -U postgres -j <number_of_cpus> --verbose --format=d ./orsanco_vm_dump_mmddyyyy.backup/ - You can use SC Pto move the backup file from VM to another Linux machine with the command:
scp -i ~/.ssh/orsanco_vm.pem -r gqc@20.14.140.39:/dbdrive/orsanco/orsanco_vm_dump_mmddyyyy.backup/ /local/path/to/dumps/ - Alternatively, you can perform the dump (or restore) command over TCP/IP, though the process is a bit more complicated:
- Allow the remote machine access to the host's database by configuring ports (UFW) and pg_hba.conf.
- When running the pg_dump command, add the argument
-h 20.14.140.39
Old Method (Potentially Slower)
- Create a dump with the command:
pg_dump --file /dbdrive/orsanco/orsanco_vm_dump_mmddyyyy.backup -U postgres --verbose --format=c orsanco - You can use SCP to move the backup file from VM to your local WSL instance with the command:
scp -i ~/.ssh/orsanco_vm.pem gqc@20.14.140.39:/dbdrive/orsanco/orsanco_vm_dump_mmddyyyy.backup /mnt/c/local/path/to/dumps/making sure to specify the proper pem file, backup file name, and local path.