New WorkflowGen data management with Docker volumes

Hi all!

As you may have noticed recently, the WorkflowGen Docker images have changed in their data management behavior. In fact, before this change, you would use three volumes to persist data:

  • appdata bound to C:\wfgen\appdata
  • wfapps bound to C:\wfgen\wfapps
  • licenses bound to C:\wfgen\licenses

For example, in command line, you would do something like this:

# Create the volumes
"appdata", "wfapps", "licenses" | ForEach-Object { docker volume create $_ }

# Copy your license to the "licenses" volume
Copy-Item C:\Path\To\WFG.lic (docker volume inspect -f "{{ .Mountpoint }}" licenses)

# Run the WorkflowGen container
docker container run `
    # ...
    --mount "type=volume,src=appdata,dst=C:\wfgen\appdata" `
    --mount "type=volume,src=wfapps,dst=C:\wfgen\wfapps" `
    --mount "type=volume,src=licenses,dst=C:\wfgen\licenses,readonly" `
    # ...
    --name wfgen `
    advantys/workflowgen:7.18.2-win-ltsc2019

Now, the appdata and wfapps volumes have been merged together. The license handling part stays the same. The reason is that when using the container in a production environment such as Kubernetes on a cloud provider, you would find yourself having two separate storage devices (disk or file share) for storing WorkflowGen data. This is not economical nor efficient. Therefore, we decided to merge them into a single volume called wfgdata. Now, when running a WorkflowGen container, you would do something like this:

# Create the volumes
"wfdata", "licenses" | ForEach-Object { docker volume create $_ }

# Copy your license to the "licenses" volume
Copy-Item C:\Path\To\WFG.lic (docker volume inspect -f "{{ .Mountpoint }}" licenses)

# Run the WorkflowGen container
docker container run `
    # ...
    --mount "type=volume,src=wfdata,dst=C:\wfgen\data" `
    --mount "type=volume,src=licenses,dst=C:\wfgen\licenses,readonly" `
    # ...
    --name wfgen `
    advantys/workflowgen:7.18.2-win-ltsc2019

To migrate an existing WorkflowGen installation, you can do the following:

Step 1: Create a new volume with data directories

docker volume create wfgdata

$mountPath = docker volume inspect -f "{{ .Mountpoint }}" wfgdata

New-Item (Join-Path $mountPath "appdata") -ItemType Directory
New-Item (Join-Path $mountPath "wfapps") -ItemType Directory

Step 2: Transfer files from old volumes to new one

$mountPath = docker volume inspect -f "{{ .Mountpoint }}" wfgdata

docker volume inspect -f "{{ .Mountpoint }}" appdata `
    | Get-ChildItem `
    | Copy-Item -Destination (Join-Path $mountPath "appdata") -Recurse -Force
docker volume inspect -f "{{ .Mountpoint }}" wfapps `
    | Get-ChildItem `
    | Copy-Item -Destination (Join-Path $mountPath "wfapps") -Recurse -Force

Step 3: Pull the newest WorkflowGen image and recreate the container

docker image pull advantys/workflowgen:7.18.2-win-ltsc2019

docker container rm -f wfgen
# Run the WorkflowGen container
docker container run `
    # ...
    --mount "type=volume,src=wfdata,dst=C:\wfgen\data" `
    --mount "type=volume,src=licenses,dst=C:\wfgen\licenses,readonly" `
    # ...
    --name wfgen `
    advantys/workflowgen:7.18.2-win-ltsc2019

Step 4: Safely delete old volumes

"wfapps", "appdata" | ForEach-Object { docker volume rm $_ }

That’s it!