10 months ago
Is there a way to clone a Postgres DB from one environment to another? I want to test a new branch with existing data.
17 Replies
10 months ago
I created this template to make it easier. Make sure to make a backup of the source DB before using it, and target DB must be clean.
Status changed to Solved brody • 11 months ago
im having issues, but i dont think it has anything to do with your template
i cant seem to add a Postgres 16 service, everytime i add a new one it installs 17 and my prod db is v16 according to the logs of the script
10 months ago
You can always pg_dump and pg_restore, jus make sure you got backups in place before that.
10 months ago
**In that fresh DB instance, with no data: **
Go into the Service Settings -> Source Image -> Click the pen icon -> at the end of the image source replace 17 with 16.
It will crash because of the version diff, just wipe the attached volume and it will redeploy correctly.

10 months ago
and as always, make sure you have backups
10 months ago
I don't think Postgres can do a major version downgrade.
10 months ago
Yeah, u also need to wipe the volume
10 months ago
Medim is saying that in reference to the Postgres 17 service, not your original database.
10 months ago
Keep us updated <:salute:1137099685417451530>