Question about setting up postgres for 20.5.0

46 views
Skip to first unread message

Jo G

unread,
Apr 27, 2021, 1:43:55 PM4/27/21
to go-cd
https://docs.gocd.org/20.5.0/installation/configuring_database/postgres.html

Our postgres DB is in RDS and AWS doesn't allow access to superuser.  Do I really need superuser to set up the GoCD database?

In the link, it tells me to assign superuser to my gocd_database_user.  Is there RDS specific instructions that I can follow?

ALTER ROLE "gocd_database_user" SUPERUSER;

Thanks,
-Johden

Aravind SV

unread,
Apr 27, 2021, 4:47:09 PM4/27/21
to Jo G, go-cd

Hello Jo,

These steps from some older documentation is what I believe works with RDS (and should really be part of the new documentation):

  1. Bring up a local PostgreSQL server. Using a database superuser account, perform the migration on this local PostgreSQL server.
  2. Once the migration is successful, take a database dump of the migrated DB:

    pg_dump --no-owner -h <db-host> -p <db-port> -U <db-user> --dbname=<gocd-server-database-name> <db-dump-file-name>.sql
    
  3. Create a PostgreSQL database on RDS and make the superuser (who is part of rds_superuser group), the owner of that database.
  4. Using the <db-dump-file-name>.sql created in step 2 above, restore the PostgreSQL database on your Amazon RDS instance:

    psql -f <db-dump-file-name>.sql -h <rds-db-endpoint> -p <rds-pg-db-port> -U <rds-pg-db-user> --password --dbname=<rds-pg-db-name>
    

The above command will prompt for the password. Once the database is restored you can point your GoCD server to that Amazon RDS instance. As always, please have a backup and test this before doing anything.

Cheers,
Aravind

Reply all
Reply to author
Forward
0 new messages