Docker Migration

From LogicalDOC Community Wiki
Jump to navigationJump to search

Sometimes you want to migrate your running Docker container to another more recent image. This How-To describe a plan to migrate a LogicalDOC Docker installation to another container, please note that this activity is delicate and may lead to data loss.

Note idea.png This guide refers to a basic single-server deployment scenario. Please be aware that this procedure is not covered by the standard support contract. In case something goes wrong during the migration process, the support team cannot offer any help and LogicalDOC is not liable for any data loss.
In case you want this delicate matter to be handled professionally, please write to for a quote.


  • Both the current container and the new one are the same version.
  • Both the current container and the new one use the same database engine


  • logicaldoc: represents the name of the current container of the installation to migrate
  • logicaldoc_new: represents the name of the new container

Step 1: Backup of the relevant files and folders from current container

  • Extract the relevant files and folders with these commands:
$ docker cp logicaldoc:/LogicalDOC/conf/
$ docker cp logicaldoc:/LogicalDOC/repository repository  

Step 2: Stop the current container

docker stop logicaldoc

Step 3: Run the new container

It is really important to install the same version of LogicalDOC as the old system and also provide the same database connection parameters and port mappings.

  • Assuming you release is the 8.9.1, this could be a sample command to run the new container:
$ docker run -d --name=logicaldoc_new -p 8080:8080 --env LDOC_USERNO=<YOUR_LICENSE_CODE> --env DB_ENGINE=mysql --env DB_HOST=logicaldoc-db --link logicaldoc-db logicaldoc/logicaldoc:8.9.1
  • Wait the new contained to complete the installation, check you are able to log into LogicalDOC as user admin like you used to do in the old container.

Step 4: Restore the relevant file in the new contanier

  • Now, with the new container up and running, restore the files backed but from the old system
$ docker cp logicaldoc_new:/LogicalDOC/conf/
$ docker cp repository/.  logicaldoc_new:/LogicalDOC/repositor

Step 4: Rename the containers

  • These instructions will rename the containers so that the new one will replace the old one
$ docker rename logicaldoc logicaldoc_old
$ docker rename logicaldoc_new logicaldoc r