Skip to main content
The XML backend is the simplest storage option for phoss SMP. All SMP data is persisted as plain XML files inside the configured data directory. There is no database server to install or manage.

Selecting the XML backend

Set the following property in application.properties:
smp.backend = xml
Use the phoss-smp-webapp-xml WAR when deploying. This is the only deployable artifact that includes the XML backend.

Data directory

All XML files are written to the directory specified by webapp.datapath:
# Use an absolute path in production
webapp.datapath = /var/smp
Always use an absolute path in production. A relative path is resolved against the application server’s working directory, which can change between restarts and may cause data to be written in unexpected locations.

File structure

Within webapp.datapath, the backend creates the following XML files on first use:
FileContents
sml-info.xmlSML (Service Metadata Locator) endpoint configuration
smp-settings.xmlSMP runtime settings
transportprofiles.xmlRegistered transport profiles
smp-servicegroup.xmlAll service groups (participants)
smp-redirect.xmlDocument-type redirects
smp-serviceinformation.xmlService metadata and endpoints
smp-participant-migration.xmlParticipant migration records
smp-business-card.xmlBusiness card data (Peppol Directory)
The security/ subdirectory holds user, role, and user-group XML files managed by the ph-oton framework.
Each file is read into memory on startup and written back atomically on every change. All in-memory state is authoritative at runtime.

File-access check

The webapp.checkfileaccess property controls whether the application verifies that all required files inside the data directory are readable at startup:
# Only set to true when datapath is a relative path inside a known WAR structure
webapp.checkfileaccess = false
Leave this false in production when webapp.datapath is an absolute path.

Docker: persisting data with volumes

When running phoss SMP in a Docker container you must mount the data directory as a volume so that XML files survive container restarts.
docker run -d \
  -v /host/path/smp-data:/home/git/conf \
  -p 8080:8080 \
  phoss-smp-xml:latest
Alternatively, in a compose.yml:
services:
  smp:
    image: phoss-smp-xml:latest
    volumes:
      - smp-data:/home/git/conf
    ports:
      - "8080:8080"

volumes:
  smp-data:
Mount the data directory at /home/git/conf (the path used in official Docker images) or override webapp.datapath in the container’s application.properties to match your mount point.

Advantages

  • No external dependencies. No database server to install, configure, or maintain.
  • Simple setup. A single webapp.datapath property is all that is required.
  • Portable. Data directory can be copied, backed up, or version-controlled as a set of plain text files.
  • Ideal for small deployments with low request rates and few participants.

Limitations

The XML backend is not suitable for high-concurrency or large-scale deployments. Because each file is loaded fully into memory and written on every mutation, concurrent write operations can become a bottleneck. For production deployments with many participants or high write volumes, consider the SQL or MongoDB backend.
  • All data is held in memory; a large number of service groups increases memory usage.
  • No built-in replication or high-availability support.
  • No connection-pool tuning or query optimization is possible.

Migrating to or from the XML backend

Exporting from XML

All data lives in the XML files under webapp.datapath. Copy these files to a safe location before switching backends.

Importing into SQL or MongoDB

phoss SMP does not include an automated migration tool. To move data from XML to another backend:
  1. Stop the SMP server.
  2. Start the server with the new backend configured.
  3. Re-register all service groups, service metadata, and business cards via the management UI or REST API.
The MongoDB backend performs an automatic one-time migration of the ph-oton security files (users, roles, user groups, user tokens) from XML if it detects an empty collection on first start. SMP-specific data (service groups, redirects, etc.) must be migrated manually.

Build docs developers (and LLMs) love