0

I am trying to deploy my postgresql server to google cloud, like how we deploy in heroku. But i am not finding any tutorial or proper docs to start. Can any one please help me in this, Thanks!

iamPavan
  • 255
  • 4
  • 15
  • Are you trying to deploy an already-created database with data in it to the Cloud? Are you trying to start a fresh DB on a VM, or are you trying to setup Cloud SQL for Postgres? – Gabe Weiss May 10 '20 at 18:04
  • @GabeWeiss there is nodejs/express server where i have used postgreSQL as the database, i am trying to deploy my express server. – iamPavan May 11 '20 at 04:54
  • So the nodejs/express server talks to the Postgres database? So you want to migrate both of these pieces to the Cloud? Both the Postgres database that is being used, AND the express application? Currently they both run somewhere locally? – Gabe Weiss May 11 '20 at 05:01
  • @GabeWeiss Yes yes – iamPavan May 11 '20 at 05:10
  • Got it, so my answer covers the DB migration piece, and info on how to move the DB to the Cloud. As for the express server, there's a few options. Do you have it all running in a Docker container? – Gabe Weiss May 11 '20 at 05:36
  • As Paddy says, this is a well worn path for Google Cloud migrations from local. I'd suggest reading up on Google Cloud Run, as that'll likely be the easiest path to migrate what you already have (just need to get what you're doing now locally into a Docker container). https://cloud.google.com/run/docs/quickstarts/build-and-deploy – Gabe Weiss May 11 '20 at 16:49

1 Answers1

1

You can easily migrate a postgres database to Google Cloud SQL. Basically it involves, creating an SQL instance, a replication using a Compute engine VM. Then seeding, and migrating your data.

The official documentation for this from google is here;

Migrate an on-premises PostgreSQL cluster to Google Cloud

This is a very good post giving a detailed step by step guide for the entire process.

How to migrate PostgreSQL databases to Google Cloud SQL

Paddy Popeye
  • 1,634
  • 1
  • 16
  • 29