neezer
neezer

Reputation: 20560

How to translate a MySQL database dump to new PG database?

I have a MySQL database with over 40,000 records I want to import into a new PostgreSQL database; I want to be able to map the values from the old table and column names into new table and column names... how do I do this?

For instance, I want to take this:

Table name: Horribly_Named_Table
=> Horribly_Named_Column: value1

(MySQL)

... and translate it to this:

Table name: better_named_table
=> better_named_column: value1

(PostgreSQL)

I've never done a move like this before, so any help is appreciated!

Upvotes: 0

Views: 267

Answers (3)

Frank Heikens
Frank Heikens

Reputation: 127086

mysqldump has a compatibility mode, check "ansi" and "postgresql".

Upvotes: 0

user330315
user330315

Reputation:

If you are only referring to the difference in UPPER/lowercase names, then you don't really need to do something.

Just make sure you are not quoting the table names and they will not be case sensitive.

This_Table_Name is the same as this_table_name and that is the same as THIS_TABLE_NAME.

But "this_table_name" is something different then "This_Table_Name"

Upvotes: 0

davek
davek

Reputation: 22915

I recommend using a simple transformation within Pentaho Data Integration: setup is very simple and there is a wizard for loading database base data from one database to another:

See a similar answer here:

Migrate from Oracle to MySQL

Upvotes: 2

Related Questions