How can I move my Amazon RDS MySql database to Heroku - mysql

I currently have a MySql database in Amazon RDS I'd like to move over to Heroku Postgres. (I would just connect my Heroku app to Amazon RDS, but I don't really want my database to be open to the public).
How can I move my database? I'd imagine:
Download from RDS
Convert MySql -> Postgres
Upload to Heroku
What's typically the best way to do something like this? Do I have to convert the database type?

Related

How do I migrate an AWS RDS MySQL database to PostgreSQL?

I currently have a MySQL AWS RDS instance, that I'd like to migrate over to PostgreSQL so that I can get off AWS and use Heroku instead.
I've tried PGLOADER,and when I enter in what I think is my MySQL database URI (mysql://username:password#hostname:port/database) and the provided PostgreSQL URI from Heroku, I get an error saying that there's no such file or directory "mysql://username:password".
I have also tried Pentaho, and I can get PostgreSQL to connect, but when I try to connect to my MySQL RDS instance, Pentaho times out, and I'm not where the my.ini file mentioned in this article is located at in order to fix it.
Any other options for migrating from MySQL to Heroku Postgres would be very appreciated.

How Ruby on rails works with Amazon RDS

I have a ruby on rails run on amazon ec2, database is mySQL.
Now I want to use Amazon RDS to backup this database in case the ec2 fails.
I read through the Amazon RDS user guide,it tells how to create a DB instance.
My question is:
1.what is the relation between created DB instance and my ec2 database?
2.When the DB instance "connect" to my ec2, what will happen?
The data used to send to ec2 mySQL server will be send to DB instance?
Is the database totally shifted to DB instance?So before I connect I should creare a same database in DB instance and tell ec2 send data to RDS ever since
3.If not,how the DB instance know the ec2 is down and takeover the data?
EDIT:
(Unsure)Is it that DB instance is just a place to put database.In order to use it,I need to set up database in DB instance,then connect to it by modifying database.yml file(this file tell rails server where the stored data goes).
How Is it possible to tell when the local database stops then at that time switch to DB instance?
There is absolutely no relationship between your EC2 MySQL DB and the RDS DB Instance. So what you are asking for is just not possible.
A better approach I would say is to have only RDS (No need to have MySQL running locally on EC2 instance). RDS takes snapshots regularly. Also, RDS is a managed service, so most of the MySQL administration tasks are handled by AWS and you don't have to worry. And you can rely on RDS snapshots from Backup perspective.

Connecting Symfony website to Amazon relational database

I am working on a symfony website and I want to connect it to a remote RDS on amazon on which i will be running some Select queries to fetch some data every time page refreshes.
Is there an easy way to do so? I was reading something about doctrine but I didn't get it how to get it to use a remote database. Is it possible to do without using doctrine?
Amazon RDS is a meta-layer to manage the database server itself. I assume you want to create a database, e.g. in MySQL, on Amazon RDS and use this database with Symfony and Doctrine.
If this is true, it is very simple: In your app/config/parameters.yml file, you have various database_* parameters. Just set the database_host to the IP address or domain of your DB server as provided by Amazon, set the correct user/password/port, and you're ready to go.

How does one see what data is stored in the RDS database?

Running our app on Amazon RDS. How does one review / inspect data in the database? For example, how can I get a list of articles?
My app is running on Ruby on Rails and on Heroku. One method I thought of, is by running the Heroku console command.
Is there a better way to see what data is stored in the RDS database?
I use MySQL Workbench to view data, run queries, and so on. It connects right up to the Amazon RDS MySQL instance using the regular MySQL settings.
Updated:
Be sure to add the ip address of the computer for which you're connecting to the RDS instance to the access list in RDS. IIRC, by default RDS instances will only accept connections from within AWS.
I was using SequelPro but they don't support ssl. Amazon RDS says something to the effect of having to use SSH to connect your EC2 to your RDS.
This is essentially what was done in the following tutorial which uses MySQL Workbench: http://thoughtsandideas.wordpress.com/2012/05/17/monitoring-and-managing-amazon-rds-databases-using-mysql-workbench/
I had also been using SequelPro before but this tutorial is very clear and I was up and running on MySQL Workbench in just a few minutes.

Migrate PostgreSQL database to MySQL

Say that I want to migrate a PostgreSQL database on Heroku to MySQL on EC2 and I need to preserve the ID values in all the tables, what's the best way to accomplish that without using paid software?
It's quite simple.
I would have mySQL instance locally, heroku db:pull to get it from Heroku Postgres to your local development mySQL instance, back it up and then restore the backup to your EC2 MySQL instance