I can migrate Oracle SQL table to PostgreSQL using ogr2ogr using:

ogr2ogr -progress -f "PostgreSQL" -nln schema.table -skipfailures -overwrite -lco FID=ID_COLUMN -lco GEOMETRY_NAME=geom PG:"host=localhost user=postgres password=yadayada dbname=database" OCI:username/password@server:port/database:schema.table

Is there a way to copy the whole schema?

  • No, or better: not easily. The proprietary FME can do that in batch, but you'd need a license. This blog article might help you save some time running ogr2ogr for each table in a schema. – ThingumaBob Jul 9 at 8:14
  • You can use scripting to run the conversion command for each table you want to move. Python for example: use it to build a lcatalof of tables to copy, then for each table construct the ogr command and execute it. You can also record progress: mark the catalog rows with success or failure, record timings etc – Albert Godfrind Jul 10 at 4:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.