Skip to content

terrestris/geoserver_sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeoServer Catalog Sync Tool

A python tool to migrate catalog info between two GeoServers via REST. This can be used to migrate from a XML/file based catalog to a database based catalog (like in GS Cloud). But in general you can use it between two GeoServer endpoints (whether GS cloud or not).

Currently the following data can be migrated:

  • workspaces
  • stores
  • styles
  • layers
  • layer groups

Migration of settings (global, WMS, WFS, ...) is not yet implemented, but could be done easily in future.

Adjust config

Adjust the config.toml to your environment or needs.

If you want to run the tool in docker and use a GeoServer available on your host, the internal docker host IP 172.17.0.1 (or whatever it is in your case) can be used to access it from the container where the sync tool is running.

Build & Run

You can run the python tool locally or in a docker container.

Local

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python src/main.py

Docker container

The local config.toml will be mounted to the container (to avoid building images that include passwords).

docker compose run --build --rm geoserver-sync

Important Notes

Passwords for Datastores

GeoServer does not accept encrypted (crypt2:...) password values via REST POSTs (as we GET them on the source side), but instead expects the raw password in the payload, which will then be stored encrypted by GeoServer.

So whenever the sync tool finds a password field/key in datastores, it will prompt the user for the raw password to be able to POST it.

Therefore you should also make sure to always use HTTPS secured GeoServers on target side!

Existing data

Some layer types require that the underlying data source (a shapefile, geopackage, geotiff) exists and is accessible at the time of creation/sync. This means the target environment must be prepared regarding correctly mounted geodata (to match the structure of the source environment).

Known issues

About

A python tool to migrate catalog info between two GeoServers using REST

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published