Search code examples
websphere

Save config (jdbc-provider, jdbc-connection, mail) from Websphere (installed as Docker)


Basis: I installed Websphere as Docker on Ubuntu and configured the JDBC settings manually.

Question: How do I export this Websphere configuration to hand it over later when creating the Docker container?

I've tried many things, but haven't gotten anywhere yet


Solution

  • You can use properties file-based configuration as a way to save (export) and then later restore (import) a WebSphere configuration.

    This works well when building Docker container images, and you'll see the Websphere traditional Docker samples using this technique.

    As you noted, though, it can be used outside of Docker/container use cases as well.

    There are several examples in the doc above including extracting cell properties:

    AdminTask.extractConfigProperties('[-propertiesFileName 
     ConfigProperties_cell.props]')
    

    and extracting server properties

    AdminTask.extractConfigProperties('[-propertiesFileName ConfigProperties_server1.props
     -configData Server=server1]')
    

    Note there is some tooling in the WebSphere traditional Docker project: https://github.com/WASdev/ci.docker.websphere-traditional to make this type of function easier to use within a Docker build (e.g. you just place the properties file in a certain location instead of having to write and call the wsadmin command yourself), so it is worth reading through the doc.