back to listing index

lfhck.com - Is there a free tool to convert mysql dump to postgres

[web search]
Original source (lfhck.com)
Tags: database postgres postgresql mysql
Clipped on: 2014-01-23

Question: Is there a free tool to convert mysql dump to postgres
Like
0

I am trying to move my site from mysql to postgres, I don't know how to do it. Already dumped my mysql database with compatible option. But it's impossible to import the data directly. I wonder if there is a free tool, with GUI to do it

I already tried several perl scripts but they appears to be buggy (no one helped)

:(

90.82% 000005 - Oleg Tarasenko

5 answers

87.13% - Gregory Pakosz Best Answer
51.01% - Alix Axel

Try SQLFairy, which seems to be a pretty solid and active project; it has conversion drivers for dozens of database systems, including MySQL and PostgreSQL.

There is a nice introduction here, for instance to convert from a MySQL dump to PostgreSQL compatible dump you need to do the following:

sqlt -f MySQL -t PostgreSQL foo-my.sql > foo-pg.sql

There is also a mysql2postgres Ruby script @ GitHub.

37.55% - Mark Carey

taps is a ruby tool that starts a webservice to transfer data between two databases: http://adamblog.heroku.com/past/2009/2/11/taps_for_easy_database_transfers/

From the site:

Taps is a temporary web service you run on a server that has access to the database you want to export. You can then run the client to connect to that service and pull data out of it in chunks. It works through firewalls, doesn’t require a direct ssh connection, and - best of all - it’s database independent. So you can export from a MySQL database and import to PostgreSQL, or vice versa.

20.65% - finspin

I just completed a seamless conversion from MySQL to PostgreSQL on Linux Mint with py-mysql2pgsql. The whole process, including installation of the python script, took about 5 mins altogether.

20.65% - Sven Lilienthal

Take a look at SQL Workbench. It has a "Data Pumper"-feature, where you can transfer all data from one DB to another. If you have access to both your DBs, that would possibly the best solution.

To quote the website:

SQL Workbench/J is a free, DBMS-independent, cross-platform SQL query tool. It is written in Java and thus it should run on any operating system that provides a Java Runtime Environment.

So, no problem running it on OS X.


Question and answers from http://stackoverflow.com/.