heroku db:pull to ubuntu postgresql - postgresql

I want to migrate my application from Heroku to my own ubuntu server. What is the correct syntax to do this using taps/heroku db:pull?

If you are moving data between a local and cloud database both of which are Postgres you should follow the instructions on Heroku's Devcenter:
https://devcenter.heroku.com/articles/migrating-data-between-plans

You would simply do heroku db:pull to pull the database from Heroku to your local db which you would then backup and restore to your own server. If it's a large database you might want to look into Heroku pgbackups as an alternative as it will provide you with a downloadable backup.
Note: If you want to migrate between databases, ie postgres => mysql then you would have to use the db:pull approach.

Related

Configuration the postrest with the postgresql database on Heroku or AWS

I need help related to the configuration of PostgREST with the PostgreSQL database dumped into Heroku or AWS.
What are the exact steps from the beginning?

How I can copy my local PostgreSQL database to Heroku for SpringBoot app

I have deployed my SpringBoot app to Heroku. Now I would like to copy my local PostgreSQL to Heroku.
I have found some information on devcenter.heroku.com.
However I don't understand enough about the using of file db.changelog-master.yaml.
Could anyone give me details about the simplest solutions to copy the database?
Create a valid dump of your local postgres database and host it somewhere publicly available. Now you will be able to restore this entire dataset (schema and records) with pg:backups:restore as shown here. The sole caveat here is that the target database must be completely empty for this to work. You can empty a Heroku postgres database with heroku pg:reset.
If you cannot take the approach listed above then you can run pg_restore directly from your local instance, provided your local version of Postgres is >= the target version of Postgres. This also applies to creating the dumpfile and is a requirement because pg utilities are not guaranteed to be forward compatible. Documentation for pg_restore is here.

Postgres / Heroku - Handling data transfer from local to remote database

I am building a Flask app which I have deployed on Heroku. I recently added a Postgres database which I have been running locally and storing data in. I'm now ready to add the remote Postgres database to my Heroku site.
My question is what are the steps to transfer data from local to the remote Postgres database on Heroku?
Thank you in advance!
You just need to export your local database using pg_dump and import it on heroku using the PGBackups function.
A full explanation of the procces can be found on:
https://devcenter.heroku.com/articles/heroku-postgres-import-export#import

Heroku Postgres configure data center location

My understanding is that Heroku Postgres runs on top of AWS. Is it possible to configure which datacenter your database is running in? I'm also wondering if the database files are stored on an encrypted filesystem.
Yes, Heroku runs on AWS. But you are not able to specify which datacenter to run your database. For encryption look at http://www.postgresql.org/docs/current/static/pgcrypto.html.
Heroku runs out of Amazon US-East - once you've add a postgres db to your app heroku config will give you the database connection URL which you would be able to tracert on to see where it is

How do I connect to my heroku shared database for postgresql?

I have pulled the SHARED_DATABASE_URL from heroku config
SHARED_DATABASE_URL => postgres://username:xxxx#host.com/db_name
I am using pgAdmin to try to connect to it but it keeps on timing out. Do I need to specify a port? What am i missing?
You can use this command to connect to psql.
heroku pg:psql
If you are happy to change to postgres 9.1 you can use the newly launched development database, which permits connections via normal postgres tools. Read more at https://postgres.heroku.com/blog/past/2012/4/26/heroku_postgres_development_plan/
You cannot access the shared database using psql, pgadmin, etc.
Heroku offers you the choice of running on a shared or dedicated database package. The shared plan is suitable for development and staging applications. It runs Postgres 8.3. The dedicated plans are suitable for production scale applications. In addition, the dedicated databases offer a number of advantages, including direct access (via psql or any native postgres library), stored procedures, and Postgres 9 support.[source]