I went into some troubles when making my first steps with QGIS server and I could not find an easy way to go.
Some context
My projects files (qgs
/qgz
) are on a remote server (Ubuntu based, headless, i.e. no GUI), where they are exposed to the web, mainly for serving raster files through the OGC WM(T)S protocol and some vector data from PostGIS to many depending applications in a larger infrastructure.
Whenever I want to change/update something in a project, I have to copy the project file over SSH to my local computer, work on it, then push it back again on the server.
This is not optimal, mainly for 3 reasons;
- Version mismatch: my local version of QGIS is more recent than on the server. Hence, I may get into troubles...
- File paths: paths of, for example, raster data are obviously not the same on my machine than on the server. I have to tweak in either way or the other, and it's especially painful to work with extra large raster. I don't want to transfer these files locally. And trying to simulate their existence locally by small subsets is OK but it involves some manual processing and, therefore, is prone to errors.
- Remote database: I've to manage to connect to the remote PostGIS using an SSH tunnel or to duplicate the database locally, which in case of a large database is not possible.
Some pseudo-solutions
With these findings, I see two possibilities (but I probably missed the obvious ones), with pros and cons for each:
Editing the raw XML: I tried to directly edit the XML based project file on the server, but it's definitely not the way to go as it becomes a really huge file; you quickly miss something or even break it. And this of course doesn't work with
qgz
files.Installing a GUI: In order to spare resources, I also want to avoid the installation of a graphical interface on the server (which would naturally make it possible to remotely work on the project solving all the previously described problems, but which need a good VPN connection).
I probably don't work in the right manner (is there just one?) with remote QGIS project files which are used/served by QGIS server.
Question
So, how do you manage to work cleanly and rigorously with remote QGIS project files, are there currently recognized best practices?
.qgs
files involves heavy lifting with SCP or rsync. I will not install X11 on the server just to RDP into QGIS Desktop. Have you found any solution? I've been thinking about exposing the QGIS projects directory over SMB.