<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi,</p>
<p>Ok - I am doing it in the text editor.</p>
<p>I also had to change</p>
<p><provider encoding="System">postgres</provider></p>
<p>to</p>
<p><provider encoding="System">ogr</provider></p>
<p>After doing this change, it worked.</p>
<p>Andreas</p>
<p>On 2018-11-05 15:01, Alessandro Pasotti wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<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:</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> </div>
<div>Hi Andreas, </div>
<div> </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> </div>
<div>then exit without saving the project, make a backup and try search replace.</div>
<div> </div>
</div>
<br />-- <br />
<div class="gmail_signature" dir="ltr">Alessandro Pasotti<br />w3:   <a href="http://www.itopen.it" target="_blank" rel="noopener noreferrer">www.itopen.it</a></div>
</div>
</blockquote>
<p><br /></p>

</body></html>