4

I have several QGIS project files (qgz) I didn't touch in quite some time that contain several layers heavily depending on a PostGIS connection and meanwhile its port number was changed (everything else of the connection is unchanged). Now I am aware of the changeDataSource plugin and back in the days I used to textedit qgs files for that purpose

My problem is that QGIS crashes when I open said project file after I have to cancel all the db-credential prompts. So I wonder which way is more promising:

  • Change the port number via editor in qgs and wrap it somehow in its qgz?
  • Provide the desired port number to QGIS via proxy or SSH tunnel if that's even possible?
2
  • take a copy of your qgz and rename it .zip >extract the file and you can edit the .qgs file with the port changes needed.
    – Mapperz
    Commented Jan 11 at 20:32
  • You could also write a Python function to do these steps in-memory.
    – Vince
    Commented Jan 11 at 22:13

1 Answer 1

0

As suggested by the commenters I did it the zip way.

In case of using Windows I recommend a using 7-zip because it automatically recognizes zip-based file formats and provides the context menus on right-click accordingly. Surely, writing a python script for that is doable but not justifiable at the moment.

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.