-
Notifications
You must be signed in to change notification settings - Fork 13
How to switch shared pqsl service to medium psql redundant
Ref: Backup or Restore Wagtail PostgreSQL database in dev, staging, or production
(on Mac)
cf install-plugin https://github.com/cloud-gov/cf-service-connect/releases/download/1.1.3/cf-service-connect-darwin-amd64
To uninstall a plugin, run this command:
cf uninstall-plugin <plugin name>
cf create-service aws-rds medium-psql-redundant <service_name>
cf connect-to-service -no-client <app_name> <existing_service_name>
pg_dump -F c --no-acl --no-owner -f fec_eregs_prod_<date>.dump postgres://<username>:<password>@<host>:<port>/<name>
cf bind-service <app_name> <service_name>
cf connect-to-service -no-client <app_name> <new_service_name>
pg_restore --dbname postgres://<username>:<password>@<host>:<port>/<name> --no-acl --no-owner <file name>
modify manifest_.yml file and push
** 1) unbind instance from app (if bound an app)**
cf unbind-service <app_name> <instance_name>
** 2) Get service key name of instance **
cf sk <instance_name>
** 3) Delete service key **
cf delete-service-key <instance_name> <service key name get from step 2)>
** 4) Delete the service **
cf delete-service <instance_name>
1)go to https://www.enterprisedb.com/downloads/postgres-postgresql-downloads download: postgresql-11.x-x-osx.dmg and install on Mac (uncheck: Stack Builder)
2)default install location: /Library/PostgreSQL/11
3)dump: /Library/PostgreSQL/11/bin/pg_dump -F c --no-acl --no-owner -f <dump_file_name>.dump postgres://<user_name>:@localhost:/<database_name>
4)restore: /Library/PostgreSQL/11/bin/pg_restore --dbname postgres://<user_name>:@localhost:/<database_name> --no-acl --no-owner <dump_file_name>.dump