DB Dump Restore
In both Windows and Linux, you should ensure that the database user gqc exists.
Windows
- Open PG Admin
- If there's an existing orsanco database, rename adhering to the following format:
orsanco_old_mmddyyyy. - Create a new
orsancodatabase. - Check that the
gqcuser exists by expanding the server (i.e. PostgreSQL 13) and expanding the Login/Group Roles menu. - Create the user and assign permissions if they don't exist:
- Select (left-click) the orsanco database in the browser window.
- Select the Tools dropdown and open an instance of the Query Tool.
- Run the following commands:
create user gqc with password 'gq010102';alter database orsanco owner to "gqc";
- Right click on the empty orsanco database and select restore.
- Navigate to and select the most recent database dump.
Linux VM
This walkthrough assumes you are already connected to the VM CLI.
Get the Dropbox download link for the DB dump and copy it to your clipboard.
In the CLI, type
wgetand paste the copied link. Make sure to remove any trailing URL parameters such as ?dl=0.Once the download has finished, switch to the postgres user with
sudo su postgresConnect to the PSQL CLI with the command
psqlRename the existing database in case you need to revert the changes with the command
ALTER DATABASE orsanco RENAME TO orsanco_old_mmddyyyy;Create a new orsanco database with the command
CREATE DATABASE orsanco;Check that the gqc user exists by running the command:
\duCreate the user and assign permissions if they don't exist:
create user gqc with password 'gq010102';alter database orsanco owner to "gqc";
Exit the PSQL CLI with the command
\qRestore the DB dump with the command
pg_restore -U postgres -d orsanco -1 orsanco_dump_mmddyyyy.backupConnect to the newly restored database in PSQL CLI with the command
psql -d orsancoGrant the existing gqc user all permissions on the public schema with the command
grant all privileges on all tables in schema public to gqc;Exit the PSQL CLI with the command
\qExit the postgres user with the command
exit