0

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!

neezer
  • 19,720
  • 33
  • 121
  • 220

3 Answers3

2

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

Community
  • 1
  • 1
davek
  • 22,499
  • 9
  • 75
  • 95
0

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"

  • Note that a mysql dump may add ` marks around table / column names. Just use a text editor or awk or sed to remove those marks and you're gold – Scott Marlowe Dec 13 '10 at 02:25
0

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

Frank Heikens
  • 117,544
  • 24
  • 142
  • 135