I have an ArcSDE enterprise geodatabase in MS SQL Server 2008. I want to replace MS SQL Server with PostgreSQL.

I have setup and created the enterprise geodatabase in PostgreSQL and now want to import the data along with the schema to PostgreSQL.

I tried with export/import XML Workspace but I get the following error:

import xml failed; The parameter is (or has an element that is) the wrong kind of geometry.

  • have you tried to use ogr2ogr?
    – DevWizard
    Commented Mar 1, 2019 at 8:30
  • thanks Sebastiano but i donot know how to use GDAL command. would be grateful if you could share the command to load data from Microsoft SQL Server to PostgreSQL.. Thanks alot
    – tsering
    Commented Mar 1, 2019 at 9:18
  • check my answer
    – DevWizard
    Commented Mar 1, 2019 at 9:19
  • Please Edit the question to specify the versions of ArcGIS in the two databases and the version of PostgreSQL. Esri stopped supporting SQL Server 2008 a while back now. Schema shouldn't make a tremendous differece, nor should geometry storage, though you should include your DEFAULTS and and other relevant DBTune keywords which control geometry storage.
    – Vince
    Commented Mar 1, 2019 at 10:47
  • 1
    I've run into similar issues going from Oracle to MS SQL Server. The workaround I used was to first import the xml into a FGDB and from there into SQL Server. Maybe this will work for going to PostgreSQL as well.
    – Dowlers
    Commented Mar 1, 2019 at 16:12

1 Answer 1


you need to download and install Gdal


and gdal command prompt will be installed by default, then you can run a command like this.

ogr2ogr -f "MapInfo File" c:\temp\TABLE.mif PG:"dbname=DBNAME user=DBUSER host=DBAddress port=DBPort" -sql "SELECT * from SCHEMA.TABLE"

ogr2ogr.exe -append -f "PostgreSQL" PG:"dbname='DBNAME' user='DBUSER' host='DBAddress' port='DBPort'" -doo ACTIVE_SCHEMA="SCHEMA" c:\temp\TABLE.mif -t_srs EPSG:DESIREDPROJECTIONID -lco geometry_name=sp_geometry

what it does is downloading your MSSQL DB and then uploading it in your PostgreSQL DB

take a look at this also


  • let me know if it's work and accept the answer if you solve the problem :)
    – DevWizard
    Commented Mar 1, 2019 at 9:25
  • The question is about using ArcGIS geodatabase tools. Translating through MapInfo is not likely to preserve any geodatabase behaviors and may in fact make the data unusable in PostgreSQL to ArcGIS.
    – Vince
    Commented Mar 1, 2019 at 10:51
  • I said run a command like this with a link where he can find more info about its specific problem, we use this command all the time and it works. but in our case we use postgres with postgres.
    – DevWizard
    Commented Mar 1, 2019 at 12:29
  • And are the PostgreSQL tables in both databases stored as enterprise geodatabase feature classes? The XML Workspace document transfers far more than just table data, so this is a formula to corrupt the data content.
    – Vince
    Commented Mar 1, 2019 at 14:31

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.