Migrate PostgreSQL database to MySQL - 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

Related

How can I move my Amazon RDS MySql database to Heroku

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?

migrating mysql instance on AWS RDS - mysql is not an option

I have an instance in RDS that is using mysql as the database engine. When I try to migrate that instance to a new one, it is only giving me options for Aurora and MariaDB. A few weeks ago I did the same thing to make a test version of the production database instance, and mysql was an option then. Any ideas on how I can make a copy of a mysql instance?

Mysql5.5 migration to RDS/Aurora

We have an mysql 5.5 installed and running on an AWS ec2 instance (r3.4xlarge type). We want to migrate to RDS/Aurora
1- RDS/Aurora can support mysql 5.6 and above. Should we first upgrade our database then move it to RDS/Aurora? Or can we do that using mysqldump directly?
Aurora has the ability to import from a 5.5 backup created with Percona XtraBackup. Dump the 5.5 database, put the backup in S3, and create aurora from that backup.
You may be able to set up replication from your ec2 instance to RDS MySQL or Aurora, as long as you're not using MyISAM tables.
Finally, you can use the AWS Database Migration tool to migrate from MySQL to Aurora.
There are two options, one is use database migration services to migrate the database from MySQL 5.5 to Aurora DB, it is recommended migration tool by Amazon, using this method you can be migrated without any outage.
Second is take backup and directly import in Aurora, it will be fast if both instances are in same region else move back up to s3 and restore it.

Is it possible to downgrade a AWS RDS from mysql 5.7 to lower version (say 5.6)

This is something i need to figure out, my company runs a number of prod RDS on AWS. Some of the mysql RDS run with 5.7 , i need to downgrade the mysql to 5.6 or 5.5 . Is this functionality provided by AWS.
Scenario: A mysql server already up and running with mysql version 5.7, Downgrade this to 5.6
-> If this is possible then what are the possible ways ?
-> How to do this ?
This is not something that AWS provides out of the box, however it can be solved with below 2 approaches depending on your database size and downtime that you can accept.
It might worth considering fixing application compatibility instead of downgrading DB which is more risky operation.
1. Dump, restore and switch method
Dump your currently running database with mysqldump utility. Start a new RDS instance with downgraded engine, load your dumped data into it. Switch your application to use RDS instance with downgraded engine.
2. Dump, restore, replicate & switch method
Dump your currently running database with mysqldump utility. Start a new RDS instance with downgraded MySQL engine, load your dumped data into it.
Set the new, downgraded DB instance as read replica of your old DB instance using mysql.rds_set_external_master and then start replication using mysql.rds_start_replication. Stop writes to your original DB, once the read replica catches up (you must monitor replication lag), run mysql.rds_reset_external_master which will promote your downgraded instance and turn off replication. Point your application to the downgraded RDS DB instance.
Method 2 will shorten your downtime to minimum, but is a bit more complex to execute. Here is a command reference to get familiar with to help you succeed: MySQL on Amazon RDS SQL Reference
You will find a great amount of examples in RDS documentation also - Importing and Exporting Data From a MySQL DB Instance:

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.