17

Was wondering if anyone had any insight or recommended tools for exporting the records from a PostgreSQL database and importing them into a MySQL database. I believe the table structure is 100% identical.

Thoughts? Thanks!

3 Answers 3

26

The command

pg_dump --data-only --column-inserts <database_name>  

will generate SQL-standard-compliant INSERT statements with all column names listed and one VALUES clause per INSERT. This is the most portable way of moving data from PostgreSQL to any other SQL database.

Sign up to request clarification or add additional context in comments.

1 Comment

Before you import the SQL file into your database, run a [bundle exec ]rake db:migrate to create the tables and columns.
5

Check out SquirrelSQL, it can pump data from one database brand into another via the DBCopy plugin. When the table structures are really identical it works quite well.

Comments

3

There is a ruby app called Taps that will do it. I've used it before with great success:

http://adam.heroku.com/past/2009/2/11/taps_for_easy_database_transfers/

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.