[Qgis-user] Migrating legacy QGIS instance

Philip Barlow philipb at pembrokeshirecoast.org.uk
Tue Aug 11 04:26:20 PDT 2020


OGR is a great option, if you wanted a GUI you could also do it with the “export to PostgreSQL” processing tool in batch processing mode (right click). Select all the layers and then you can auto fill the fields for primary key, geometry column etc.

Phil


From: Qgis-user <qgis-user-bounces at lists.osgeo.org> On Behalf Of Charles Dixon-Paver
Sent: 11 August 2020 11:45
To: Walt Ludwick <walt at valedalama.net>
Cc: qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] Migrating legacy QGIS instance

Easiest way for me is to use the GDAL ogr2ogr<https://gdal.org/programs/ogr2ogr.html> command using a bash script or cmd batch to traverse your directories (depending on how you installed QGIS this should be on your path). I don't know what environment you're running though.

You can either stick multiple shps into a single gpkg or create one per feature as you prefer. ogr2ogr can also push shp files directly into PostGIS. When you want to consolidate or migrate data (between gpkgs or from gpkg to PostGIS) you can simply select the feature layers you want and use drag and drop from the QGIS 3 Browser panel to copy multiple features to a target location.

Others might have different approaches though.

Regards

On Tue, 11 Aug 2020 at 12:24, Walt Ludwick <walt at valedalama.net<mailto:walt at valedalama.net>> wrote:
I've inherited a legacy GIS, built up over some years in versions 2.x, that i'm now responsible to maintain.  Being an almost complete n00b (did take a short course in QGIS a good few years ago, but still..), i could really use some advice about migration.

i've created a new QGIS instance in version 3.14, into which i am trying to bring all useful content from our old system: oodles of shapefiles, essentially, plus all those other files (each .shp file appears to bring with it a set of.shx, .dbf, .prj, qpj  files, plus a .cpg file for each layer, it seems).  This is a significant dataset- 14gb, >1000 files -and that is just base data, not counting Projects built on this data or Layouts used for presenting these projects in various ways. Some of this is cruft that i can happily do without, but still:  i've got a lot of porting-over to do, without a clear idea of how best to do it.

The one thing i'm clear about is: i want it all in a non-proprietary database (i.e. no more mess of .shp and related files) that is above all quick & easy to navigate & manage. It is a single-user system at this point, but i do aim to open it up to colleagues (off-LAN, i.e. via Internet) as soon as i've developed simple apps for them to use.  No idea how long it'll take me to get there, so...

Big question at this point is: What should be the new storage format for all this data?  Having read a few related opinions on StackOverflow, i get the sense that GeoPackage will probably make for easiest migration (per this encouraging article<https://medium.com/@GispoFinland/learn-spatial-sql-and-master-geopackage-with-qgis-3-16b1e17f0291>, it's a simple matter of drag&drop -simple if you have just a few, i guess! [1]), and can easily support my needs in the short term, but then i wonder: How will i manage migration to PostGIS when i eventually put  this system online with different users/ roles enabled?

[1] Given that i need to pull in some hundreds of .shp files that are stored in a tree of many folders & subfolders, i also wonder: is there a simple way that i can ask QGIS to traverse a certain directory, pull in all the .shp files -each as its own .gpkg layer, i suppose?

Any advice about managing this migration would be much appreciated!
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Mae'r Awdurdod yn hapus i gyfathrebu yn Gymraeg neu yn Saesneg

The Authority is happy to communicate in Welsh or English


*********************************************************************** 
Website www.pembrokeshirecoast.wales
Follow us on Twitter 
Join us on Facebook
Watch us on Youtube 
Look at us on Flickr


This email and any attached files should only be read by those persons to whom
they are addressed and be used by them only for their intended purpose.
If you are not the intended recipient please destroy all copies and inform the
sender by return email.

Please note that the contents of this email may be subject to public disclosure 
under the Freedom of Information Act 2000 and therefore the confidentiality of 
this message and any reply cannot be guaranteed.

Click here to view PCNPA Privacy Notice – Keeping your Information Safe

For further information on the PCNPA please visit our website at www.pembrokeshirecoast.wales

Please consider the environment before printing this email.

Dim ond y personau hynny yr anfonwyd yr e-bost hwn atynt ac unrhyw ffeiliau sydd 
ynghlwm ddylid eu darllen, a dim ond hwy ddylid eu defnyddio at y diben y bwriadwyd hwy. 
Os nad y chi yw'r person y bwriadwyd eu derbyn a fyddech gystal â dinistrio pob copi a rhoi 
gwybod i'r anfonwr gyda throad yr e-bost.

Noder os gwelwch yn dda y gall cynnwys yr e-bost hwn orfod cael ei ddatgelu i'r cyhoedd o 
dan Deddf Rhyddid Gwybodaeth 2000 ac felly ni ellir gwarantu cyfrinachedd y neges hon 
nac unrhyw ateb. 

Cliciwch yma i weld Hysbysiad Preifatrwydd APCAP - Cadw eich Gwybodaeth yn Ddiogel 

Am ragor o wybodaeth am APCAP ymwelwch â'n gwefan ar www.arfordirpenfro.cymru 

Ystyrier yr amgylchedd cyn argraffu'r e-bost hwn os gwelwch yn dda.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20200811/3ac38520/attachment.html>


More information about the Qgis-user mailing list