<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Nov 5, 2018 at 2:54 PM Andreas Neumann <<a href="mailto:a.neumann@carto.net">a.neumann@carto.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<p>Hi,</p>
<p>I have a relatively complex QGIS project with data storage in QGIS and would like to change the data source of all layers to Geopackage.</p>
<p>I already have a Geopackage with the exact same data structure like in Postgis (automatic export from Postgis through ogr2ogr).</p>
<p>Now I wonder what the best approach is to change all data sources from Postgis to Geopackage?</p>
<p>Texteditor and search/replace or is there something more comfortable?</p></div></blockquote><div><br></div><div>Hi Andreas, <br></div><div><br></div><div>you could first check if it works correctly with one layer, from the python console vl.changeDataSource('/my/new/path|layername=mylayername', 'layer_name', 'ogr')</div><div><br></div><div>then exit without saving the project, make a backup and try search replace.</div><div><br></div></div><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Alessandro Pasotti<br>w3:   <a href="http://www.itopen.it" target="_blank">www.itopen.it</a></div></div>