2

I have done the depot application using mysql... Now i am in need to use postgres... So i need to dump data from mysql database "depot_development" to postgres database "depot_develop"...

3 Answers 3

1

Here you can find some interesting links http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#MySQL

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

1 Comment

i did try that but the syntax where not matching with psql... so had many errors.. it didnt work wel... thanks..
1

Have you tried to copy the tables from one database to the other:

a) export the data from MySQL as a CSV file like:

$> mysql -e "SELECT * FROM table" -h HOST -u USER -p PWD -D DB > /file/path.csv'

and then,

b) import it into Postgres like:

COPY table FROM '/file/path.csv' WITH CSV;

2 Comments

I had the problem of logging in without data in the users table... so i had no choice to insert data copying from the already existing table... so manually inserted data in psql... so the it was ok to work.. thank you..
The mysql query above doesn't create output in CSV.
0

This question is a little old but a few days ago i was dealing with this situation and found pgloader.io.

This is by far the easiest way of doing it, you need to install it, and then run a simple lisp script (script.lips) with the following 3 lines:

/* content of the script.lisp */
LOAD DATABASE
FROM mysql://dbuser@localhost/dbname
INTO postgresql://dbuser@localhost/dbname;


/*run this in the terminal*/
pgload sctipt.lisp

And after that your postgresql DB will have all of the information that you had in your MySQL SB

On a side note, make you you compile pgloader since at the time of this post, the installer has a bug. (version 3.2.0)

1 Comment

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.