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#

  1. Open QGIS
  2. In Browser panel, right-click WMS or WFS
  3. Select New ConnectionImport
  4. Select your geoserver_connections.xml file
  5. Enter credentials when prompted (if required)

Method 2: Settings Menu#

  1. Go to SettingsOptionsAuthentication
  2. Click Import and select your XML file
  3. Configure authentication as needed

Output Format#

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).

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#

  1. Verify XML file format is correct
  2. Check that QGIS version supports the connection format
  3. 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