Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.postgresql > #676

Re: migrate from mysql to pgsql

From Harry Tuttle <SOZRBLNTLEEE@spammotel.com>
Newsgroups comp.databases.postgresql
Subject Re: migrate from mysql to pgsql
Date 2015-10-30 20:26 +0100
Message-ID <d9huikF79brU1@mid.individual.net> (permalink)
References <n10ens$huf$1@news.m-online.net>

Show all headers | View raw


Magnus Warker schrieb am 30.10.2015 um 20:00:
> I would like to migrate a mysql database to pgsql.
> I would like to do it table for table.
>
> Can you export a table into a plain-text SQL file so that it can be edited and imported in pgsql?

Ora2Pg has been a reliable tool to migrate from Oracle to Postgres.

The latest release also supports migrating from MySQL to Postgres, you might want to look into that:

    http://ora2pg.darold.net/


Apart from that, you can use any tool that is capable of exporting CSV files and then
import them using Postgres' COPY command.

I haven't really used MySQL but I believe SELECT ... INTO OUTFILE should be usable to do this table by table.

I use a SQL tool called SQL Workbench/J which can bulk export all tables from a database:

http://www.sql-workbench.net/
and
http://www.sql-workbench.net/manual/command-export.html

I have used that successfully for migrations from Oracle to Postgres.


Another option is to install mysql_fdw in Postgres and then simply pull the MySQL data through
SQL statements from within Postgres: http://pgxn.org/dist/mysql_fdw/

As a final note: if you need help with Postgres, you'll get better responses on the Postgres mailing list

    http://www.postgresql.org/list/

Once you are registered you can also read them through a newsgroup on news.gmane.org



Back to comp.databases.postgresql | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

migrate from mysql to pgsql Magnus Warker <magnux@mailinator.com> - 2015-10-30 20:00 +0100
  Re: migrate from mysql to pgsql Harry Tuttle <SOZRBLNTLEEE@spammotel.com> - 2015-10-30 20:26 +0100
    Re: migrate from mysql to pgsql Magnus Warker <magnux@mailinator.com> - 2015-11-14 04:25 +0100
      Re: migrate from mysql to pgsql Dimitri Fontaine <dimitri@2ndQuadrant.fr> - 2015-11-14 20:32 +0100
        Re: migrate from mysql to pgsql Magnus Warker <magnux@mailinator.com> - 2015-11-18 17:58 +0100
  Re: migrate from mysql to pgsql Dimitri Fontaine <dimitri@2ndQuadrant.fr> - 2015-11-01 22:09 +0100
  Re: migrate from mysql to pgsql Luuk <luuk@invalid.lan> - 2015-11-02 09:18 +0100
  Re: migrate from mysql to pgsql Magnus Warker <magnux@mailinator.com> - 2016-01-06 06:43 +0100
    Re: migrate from mysql to pgsql Robert Klemme <shortcutter@googlemail.com> - 2016-01-06 13:08 +0100
      Re: migrate from mysql to pgsql Magnus Warker <magnux@mailinator.com> - 2016-01-06 13:35 +0100
    Re: migrate from mysql to pgsql Dimitri Fontaine <dimitri@2ndQuadrant.fr> - 2016-01-06 21:31 +0100
      Re: migrate from mysql to pgsql Magnus Warker <magnux@mailinator.com> - 2016-01-31 06:21 +0100
        Re: migrate from mysql to pgsql Dimitri Fontaine <dimitri@2ndQuadrant.fr> - 2016-01-31 22:19 +0100

csiph-web