Docker Upgrade to OpenHAB 2.1.0 Hangs on Start

Something odd has been happening in my attempts to upgrade OpenHAB to 2.1.0. I run my environment in Docker on a Ubuntu 16.04 LTS server. I flushed out userdata/tmp and userdata/cache, but the startup hangs when trying to bind a port for the Karaf SSH console:

2017-07-15 17:16:10.389 [DEBUG] [org.eclipse.osgi                    ] - FrameworkEvent STARTLEVEL CHANGED - org.eclipse.osgi
2017-07-15 17:16:10.389 [DEBUG] [org.apache.karaf.main.Main          ] - Start level change complete.
2017-07-15 17:16:10.395 [DEBUG] [          ] - ServiceEvent REGISTERED - {org.apache.sshd.SshServer}={, service.bundleid=26, service.scope=singleton} -
2017-07-15 17:16:10.396 [INFO ] [ll.impl.action.osgi.CommandExtension] - Registering commands for bundle
2017-07-15 17:16:10.409 [DEBUG] [] - Creating Nio2Acceptor
2017-07-15 17:16:10.410 [DEBUG] [] - Binding Nio2Acceptor to address /

Nothing else is using port 8101, so I’m very confused as to why Karaf is freezing at this point. Nothing changes if I leave it alone for an hour, and neither restarting the container nor restarting the host fix the issue. Yet, I can still roll back to 2.0.0-amd64 if I flush the userdata/cache and userdata/tmp folders, so I’m guessing something changed in 2.1.0?

Here’s my docker-compose.yml file, just in case it helps:

      container_name: openhab-app
         - "/dev/ttyACM0:/dev/ttyACM0"
         OPENHAB_HTTPS_PORT: '8443'
         OPENHAB_HTTP_PORT: '8080'
         USER_ID: '1033'
      image: openhab/openhab:2.1.0-amd64
      network_mode: "host"
      restart: always
         - /etc/localtime:/etc/localtime:ro
         - /etc/timezone:/etc/timezone:ro
         - openhab_app_addons:/openhab/addons
         - openhab_app_conf:/openhab/conf
         - openhab_app_java:/openhab/.java
         - openhab_app_userdata:/openhab/userdata
version: '3.2'
      external: true
      external: true
      external: true
      external: true

Has anyone else been successful upgrading using Docker?

Nevermind, I solved the problem. When you upgrade to a later version of the Docker container, you need to do the following:

  1. Set your userdata volume to a different location (in my environment I changed the NFS volume to point to a folder named userdata-2.1)
  2. Pull and run your updated container. Stop it once it is running and all the bindings have been installed.
  3. Delete the jsondb, openhabcloud and persistence folders from your new userdata folder, as well as the uuid file.
  4. Copy the files/folders from the old userdata folder to the new one. Only copy over objects you deleted in the previous step.
  5. Restart the container. All should be working now.