I am considering to move our site's database from our dedicated db server to heroku postgres. as we have a few gigs of data in the db and don't want to take it down for a long migration downtime it appeared to me that it might be possible to set up replication(following in heroku terms) from our current database server to a heroku 'follower' database. We could then make our current db read-only for a short time while the heroku comes up to date and then make the switch very quickly. the heroku documentation(https://devcenter.heroku.com/articles/heroku-postgres-follower-databases#database-upgrades-and-migrations) mentions replication between databases of different heroku apps, but it does not touch on the scenario i want to set up where the master db is not on heroku. Anyone thinks or knows this is doable?

migrated from stackoverflow.com Jun 18 '13 at 7:12

This question came from our site for professional and enthusiast programmers.

  • I suspect not. Heroku use their own PostgreSQL build, and it might not be 100% binary compatible. You'd also need a way to add an entry for your DB to the Heroku DB's pg_hba.conf with replication rights, which I'm not sure Heroku offers. – Craig Ringer Jun 17 '13 at 23:43

It's not supported in either direction, with the most pressing problem being the platform and architecture dependence of that replication method.

In the case of migrating to the service, the problem is doubly so, because slurping random, physical base backups from the internet as would be required to set up replication as it is seen today is a somewhat ticklish sounding proposition.

It sucks, and I'd like to lift that restriction some day, if that and the other problems (some not) can be solved.

Please feel free to write into postgres@heroku.com if you want to discuss your problem in more detail, although I'm most unsure if we have the technology to make this a super-easy proposition right now. Still, the main way we can make it better is by studying it, if you'd be so kind to share.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy