how can i restore a postgres backup from my laptop into a Heroku environment - heroku-postgres

I have created a heroku account and added the postgres sql DB. I have a babckup DB located on my laptop. How can I restore this backup into my new Heroku database.
help appreciated.
i can see where to create and download backups but unable to find where to restore or import a DB
the backup is from a heroku postgres DB

Related

After migrating the development DB and the Parse Server, is it possible to migrate the production DB?

i'm now trying to migrate my parse db to a mLab with a parse server hosting it in AWS Elastick Beanstalk.
While migrating, I had few pending problems and i will be glad if you know about these questions.
After migrating the DB, will the parse server that is hosted by
Parse.api.com will continue connecting to the DB that is migrated?
After deploying my development DB and parse server to mongoLab and AWS, will the parse.api.com with the production DB still remains running with the app that is used by the user?
After migrating the development DB and also the Parse Server to AWS, is it possible to migrate the prduction DB?
After migrating the DB, will the parse server that is hosted by
Parse.api.com will continue connecting to the DB that is migrated?
That is correct, api.parse.com will hit your self-hosted database for as long as you don't delete the app on parse.com/close your Parse account or until Parse shuts down in January 2017.
Should you chose to delete the app on parse.com, all users that haven't updated to a version of your app that uses your own Parse Server will be left with a broken app until they install the update of your app.
After deploying my development DB and parse server to mongoLab and AWS, will the parse.api.com with the production DB still remains
running with the app that is used by the user?
Assuming that your development and production Parse Apps are two different apps on Parse you will need to migrate them separately and yes, if you only migrate your development app (let's call it App A for now), App B (your production app) won't be effected until you migrate it as well. Of course any non-migrated app will stop working all-together at the end of January 2017.
After migrating the development DB and also the Parse Server to AWS, is it possible to migrate the production DB?
You are free to migrate as many databases/apps you want. So the answer is yes, you can migrate your production/development versions as well.

How do I deploy my rails app to Heroku using an existing SQL database?

I have an existing MySQL database and would like to build a Rails app on top of it. How do I deploy my app to Heroku but still use my existing database instead of the default PostgreSQL database?
EDIT
Rephrasing the question slightly (formerly, it was "Is it possible to deploy...").
Yes. You can configure your application any way you like including specifying a non-Heroku database in your config file, and including using the default Heroku paradigm of using environment variables for config but with manually set database URLs in the environment variables.
You can either continue hosting your MySQL database separately, or migrate your data to a MySQL database hosted within the Heroku platform, like ClearDB (provided as a Heroku add-on).
Yes, although Heroku recommends that you use PostgreSQL, it is possible to migrate MySQL to Postgres with their service. They have an article in their docs for just such a scenario: https://devcenter.heroku.com/articles/heroku-mysql
They recommend you first install the http://rubygems.org/gems/mysql2psql gem
If your needs are MySQL specific and you have to use heroku clearDB has and addon https://addons.heroku.com/cleardb that you can use with your heroku app.

Deploy rails app on dotcloud

I'm trying to deploy a ruby on rails app to dotcloud. The app is deployed but when I try to access the url, I get this error:
could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? (PG::Error)
I'm using a postgresql database. What all changes do I need to make in the database.yml file?
I've also followed the steps outlined here:
http://docs.dotcloud.com/services/postgresql/
Can anyone please help on this?
It looks like your app is configured to use a local PostgreSQL database (local as in "running on the same machine"). You should make sure that your dotcloud.yml file contains a section for a PosgreSQL database, e.g.:
db:
type: postgresql
Then use either dotcloud info to retrieve the host, port, and credentials of the database, or parse them from environment.json in your Ruby app.
This last step is explained in the dotCloud PostgreSQL service documentation.

How do I sync a local rails database with a remote database?

I've used Taps before on Heroku, but what is a good solution on non-heroku rails apps?
You could create a capistrano task/s to mysqldump on the source database, gzip the file, then scp it to the destination and execute the mysql script there to import.
I wrote a Capistrano recipe some time ago to sync a MySQL database and files between different environments: https://gist.github.com/111597
OK, there are some things you need to keep in mind. If you are using SQlite for development and MySQL / Postgre for production on the server, then sinking is almost impossible. On the contrary if you are using the same DB engines you can use administrator interface like MySQL administrator on your desktop and generate a backup file and upload it to server and vice versa.
May hosting providers provide PHPMyAdmin to take backups and restore it on the server.

Use Heroku DB into Engine Yard

I am using postgresql database for my Heroku Application.
I have very large database on AmazonAws as heroku not providing the Postgresql Database.
Now my client want to switch to EngineYard from Heroku.
Can i use same database (w/o taking backup and then reload) for my application on the EngineYard?
If YES
How can i use or steps for using the Existing AmazonAws Database with the new EngineYard Application.
You can, but only if you are using a dedicated database. From the Heroku database FAQ
Shared Database
No, connecting to your database from machines outside of Heroku is not
supported. We recommend that you encapsulate data access in an API to
manipulate it.
Dedicated Database
It's possible to connect to our dedicated databases using our
pg:ingress feature. Please see using the PG console for more
information.
The database connection string is available in the DATABASE_URL config. You can run
$ heroku config --long
to view it. However, it won't probably work if you use a shared database because it seems connection is restricted to the Heroku net.
Surely this is just a case of getting the correct connection credentials for the DB regardless of where it's hosted?
For instance, if the DB is on Heroku, then ENV['DATABASE_URL'] give you everything you need. All these details then go in your database.yml as normal (assuming you're using ActiveRecord)
For the record, Heroku do provide Postgres and it's part of their core business.

Resources