phpPgAdmin for Heroku database - heroku

When I create an app in Heroku and add a database (PostgreSQL) to it, is there a way to add a web interface for that database (such as phpPgAdmin)?

I'm no expert, but I think you can't have this functionality. Have a look at the monitoring section; in case you want to get some logs. Furthermore it's worth checking Heroku Postgres add-on section. There you can find details about different plans e.g. they include different features.
However, there is a way to connect to Postgres database on Heroku using pgAdmin [not web interface] as answered in this SO Question and this DBA Stackexchange.
Hope this helps until some extend.

If you do not mind running the web interface locally, you can use phppgadmin to manage the Heroku postgreSQL db.
This is easily done by spinning a docker container.
docker pull dockage/phppgadmin
docker run --name=phppgadmin-heroku -d --publish=81:80 -e PHP_PG_ADMIN_SERVER_HOST=<your_db_url_from_heroku> -e PHP_PG_ADMIN_SERVER_DEFAULT_DB=<your_db_name_from_heroku> -e PHP_PG_ADMIN_OWNED_ONLY=true dockage/phppgadmin:latest
This will run the phppgadmin on http://localhost:81. Of course, the same container could be deployed on Heroku, if a local deployment is not enough for your needs.

Related

How can I automatically import a dump from an app in Heroku CI's in-dyno postgres instance?

I am using Heroku CI with an in-dyno postgres instance. When the test dyno starts up I would like to fill the in-dyno postgres with the data of one of my running Heroku apps. How can I do this in the nicest way?
You would have a test-setup script that then restores a production-backup into your local postgres instance. We are doing this for some test-environments or database load-tests.
But in general there is to say this not a good idea. Your tests should setup their own test-data (setup/teardown scripts for fixtures). Otherwise you'll quickly run at least into performance issues.

Trying to setup heroku app on my pc

I am going through the getting started guide with heroku and I hit a snag, cannot seem to access the remote database it connects but there is no database name. I have installed postgres sql 9.5 locally but attempting to push the local database I created fails also and when i run heroku pg:info it never responds.
I am going through the documentation but there is a lot of it, so hopefully some psql wizard will see this and go, oh this is what he is doing wrong and let me know.
It's likely that you have not "Created" the database. rake db:create - This needs to be done on Heroku's servers and your local machine.
Not quite correct,I am not using ruby, one major caveat I did not notice initially is that I was not in the bash shell which might have been part of my problem, what i wound up doing was connecting to the postgresql remote instance from my local install using pgadmin and creating the table manually from there. I had to get the connection info which I obtained by using heroku pg:credentials DATABASE which gave me the info I needed to add the server in pgadmin, you do need to check ssl for that within the tool, and it helps to add the database name to restricted so you see only your database, not the whole 10 gazillion they have in production :) I hope this helps anyone else that has the same problem.
Thanks

Where are my application files after deploy to google compute engine?

I'm following the tutorial to deploy a ruby app to google compute engine. Everything works, however I now want to ssh into the app to run migrations etc. After some searching i was able to find my files under a docker instance here /var/lib/docker/aufs/diff/e2972171505a931749490e13d21e4f8c0bb076245ef4b592aff6667c45b2dd13/app
Is there a simpler way to access my files? perhaps a symlinked folder?
Ruby apps on Google AppEngine run via Docker. Because AppEngine is a PaaS provider, it's discouraged (though possible) to run commands on production machines. If you'd like to run database migrations, please run them locally and point your configuration at your production database.

Addons for standalone heroku postgres database

Is it possible to attach addons to a standalone postgres database created at https://postgres.heroku.com ? I'm using the dev plan.
The database details page # https://postgres.heroku.com/databases/ shows "Heroku PG-Backups addon not attached" under Snapshots heading. I couldn't find a way to add the PG-Backups addon.
You probably need to take a look at the docs: https://devcenter.heroku.com/articles/pgbackups#provisioning-the-add-on

Heroku. db:push when I app contains two databases

I have Rails 3.2 application hosted on Heroku. My application contains two databases (one for my model, the second is a kind of a dictionary with static data).
I need to push the second database (dictionary) to Heroku, but when I try db:push Heroku thinks that I'm going to push the first database (with Rails model).
The question is - how could I specify that I want to push my local database dictionary.sqlite to heroku dictionary.pg?
You could use the Heroku pg:transfer plugin which will let you set the target destination by it's URL.
https://github.com/ddollar/heroku-pg-transfer
Alternatively, use psql client locally but restore to the heroku pg isntance.
Don't use db:push/pull; those methods are deprecated. Use pgbackups:capture/restore for things like this. It accepts the HEROKU_POSTGRESQL_COLOR as part of the command:
$ heroku pgbackups:restore HEROKU_POSTGRESQL_COLOR 'https://example.com/data.dump' --app app-name
See Importing and Exporting Heroku Postgres Databases with PG Backups for more detailed explanation.
Also, heroku-pg-transfer has been integrated into pg-extras, check that out here: https://github.com/heroku/heroku-pg-extras

Resources