-
Navigate to the Cloud SQL Console
-
Click on create instance
-
Select PostgreSQL
-
Give it an id and password. Make sure to note down the password
-
Set database version to PostgreSQL 15
-
Select Enterprise
-
Select production or development depending on needs
-
Click on customize instance
-
In connections, add a new network as authorized network
name: allowall
network: 0.0.0.0/0
-
Click done
-
Click create instance
-
Wait for the instance to be created - this can take 5 to 10 minutes
-
Once its created, copy the public IP address. This will be used as host when connecting
-
Install PostgreSQL 15 for the psql command line tool
-
Run
psql -h <public-ip-address> -U postgres -d postgres
- Once connected, run the following command to create a new database
CREATE DATABASE ovatify;
-
Once the database has been created, run \q to exit
-
Navigate to the directory of the backup.sql file, then run
psql -h <public-ip-address> -U postgres -d ovatify -f backup.sql
-
Wait for the operation to complete
-
Connect to the database
psql -h <public-ip-address> -U postgres -d ovatify
- Run a test query
SELECT COUNT(*) FROM users_user;
DB_USERNAME: postgres
DB_NAME: ovatify
DB_PASSWORD: <database password>
DB_HOST: <database public IP address>