QGIS Connections Export#
Generate QGIS connection XML files for importing WMS/WFS connections into QGIS.
Basic Usage#
Export to File#
1
2
3
4
5
| # Single workspace
./geoserver-cli qgis export connections -w my_workspace -o geoserver_connections.xml
# All workspaces
./geoserver-cli qgis export connections --all-workspaces -o geoserver_connections.xml
|
Export to Stdout#
1
| ./geoserver-cli qgis export connections -w my_workspace
|
Import into QGIS#
Method 1: Browser Panel#
- Open QGIS
- In Browser panel, right-click WMS or WFS
- Select New Connection → Import
- Select your
geoserver_connections.xml file - Enter credentials when prompted (if required)
- Go to Settings → Options → Authentication
- Click Import and select your XML file
- Configure authentication as needed
The generated XML follows QGIS connection format:
1
2
3
4
5
6
7
8
9
| <?xml version="1.0" encoding="UTF-8"?>
<qgs>
<WMSServers>
<WMSServer name="GeoServer WMS (my_workspace)" url="http://localhost:8080/geoserver/my_workspace/wms"/>
</WMSServers>
<WFSServers>
<WFSServer name="GeoServer WFS (my_workspace)" url="http://localhost:8080/geoserver/my_workspace/wfs"/>
</WFSServers>
</qgs>
|
Credentials#
Without Credentials (Default)#
1
2
| # Credentials NOT included (recommended)
./geoserver-cli qgis export connections -w my_workspace -o connections.xml
|
Configure authentication using QGIS Auth Manager (see QGIS Authentication Guide).
With Credentials (Not Recommended)#
1
2
| # Include credentials (NOT recommended for production)
./geoserver-cli qgis export connections -w my_workspace -o connections.xml --include-credentials
|
!!! warning “Security Risk”
Including credentials in XML files is a security risk. Files may be accidentally committed to version control or shared insecurely.
Examples#
Development Environment#
1
2
3
4
| # Export connections for local development
./geoserver-cli qgis export connections -w dev -o dev_connections.xml
# Import into QGIS and configure auth once
|
Production Environment#
1
2
3
4
| # Export without credentials
./geoserver-cli qgis export connections -w production -o prod_connections.xml
# Share file with team (each configures their own auth)
|
Multiple Workspaces#
1
2
| # Export all workspaces
./geoserver-cli qgis export connections --all-workspaces -o all_connections.xml
|
Troubleshooting#
Connections Don’t Appear#
- Verify XML file format is correct
- Check that QGIS version supports the connection format
- Ensure file permissions allow QGIS to read it
Authentication Issues#
See QGIS Authentication Guide for detailed troubleshooting.
URL Mismatches#
If connections don’t work, verify:
- GeoServer URL is accessible from your machine
- Workspace name matches exactly
- WMS/WFS services are enabled in GeoServer