Re: MSSQL to PostgreSQL Migration

From: Gilles Darold <gilles(at)darold(dot)net>
To: Pascal CROZET <pascal(dot)crozet(at)metanext(dot)com>, Datta D <dattadeshpande(dot)it(at)gmail(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: MSSQL to PostgreSQL Migration
Date: 2023-01-05 10:13:15
Message-ID: 7f8c93f4-1e3b-44a6-ef69-8a44cadfdd5d@darold.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Le 02/01/2023 à 09:22, Pascal CROZET a écrit :
>
> Datta D.
>
> I’ve read MySql instead of MsSql :/ Sorry. I prefer to name it as
> SqlServer, to avoid this issue.
>
> In this page
> <https://dbconvert.com/blog/migrate-data-from-sql-server-to-postgresql/>,
> you can found /pgloader or Sqlserver2pgsql/as open source tools
>

Actually, I need it for a customer migration at MigOps, so it does since
few days:

commit 7d9796b2949982867925eaebaa112bf5520403d5
Merge: 4220916 c911903
Author: Gilles Darold <gilles(at)darold(dot)net>
Date:   Tue Nov 29 21:11:58 2022 +0100

    Add SQL Server migration to Ora2Pg. Most of the SQL Server objects are
    supported as well as data export. Translation of the TSQL stored
    procedures to plpgsql is complicated because of the lack of statement
    separator in TSQL but as usual Ora2Pg is doing is best to do as much
    work as possible. Migration assessment is also possible with SQL Server
    database. There is some dedicated configuration directives added to
    ora2Pg.conf.

I have planned to publish a new release and an announcement this month.
Note that it is a new feature that needs to be polished, your feed back
will be welcome.

If you can't wait the new release you can download the development code
using git or as an archive from
https://github.com/darold/ora2pg/archive/refs/heads/master.zip

It just works like an Oracle migration, the most complicated thing is to
connect Ora2Pg to the remote SQL Server database :-)

There is only 2 new configuration directive related to this RDBMS:

  Control SQL Server export behavior
    DROP_ROWVERSION
        PostgreSQL has no equivalent to rowversion datatype and feature, if
        you want to remove these useless columns, enable this directive.
        Columns of datatype 'rowversion' or 'timestamp' will not be
        exported.

    CASE_INSENSITIVE_SEARCH
        Emulate the same behavior of MSSQL with case insensitive search. If
        the value is citext it will use the citext data type instead of
        char/varchar/text in tables DDL (Ora2Pg will add a CHECK constraint
        for columns with a precision). Instead of citext you can also set a
        collation name that will be used in the columns definitions. To
        disable case insensitive search set it to: none.

Look at documentation (README) on how to migrate a SQL Server database
with Ora2Pg.

Best regards,

--
Gilles Darold
MigOps Inc
http://www.migops.com/

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ron Watkins 2023-01-05 13:46:24 Looking for Oracle to Postgres conversion tools
Previous Message Rich Pixley 2023-01-04 17:09:43 csv vs json?