Difference between revisions of "Docker Migration"

From LogicalDOC Community Wiki
Jump to navigationJump to search
(Step 4: Restore the relevant file in the new contanier)
(Step 4: Rename the containers)
Line 35: Line 35:
 
* These instructions will rename the containers so that the new one will replace the old one
 
* These instructions will rename the containers so that the new one will replace the old one
 
  $ docker rename logicaldoc logicaldoc_old
 
  $ docker rename logicaldoc logicaldoc_old
  $ docker rename logicaldoc_new logicaldoc r
+
  $ docker rename logicaldoc_new logicaldoc
  
 
[[Category: Migration]]
 
[[Category: Migration]]

Revision as of 07:36, 16 August 2024

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 sales@logicaldoc.com for a quote.


Assumptions

  • 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

Definitions

  • 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 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 your release is the 8.9.3, 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.3
  • 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 conf/.  logicaldoc_new:/LogicalDOC/conf
$ docker cp repository/.  logicaldoc_new:/LogicalDOC/repository

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