Difference between revisions of "Docker Migration"

From LogicalDOC Community Wiki
Jump to navigationJump to search
(Step 3: Run the new container)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{TOCright}} __TOC__
 
{{TOCright}} __TOC__
  
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.
+
Sometimes you want to migrate your running Docker container to another more recent image(but same LogicalDOC's application version). 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.
  
 
{{Advice|This guide refers to a basic single-server deployment scenario. <b><u>Please be aware that this procedure is not covered by the standard support contract</u>.</b> <u>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</u>.<br/> In case you want this delicate matter to be handled professionally, please write to sales@logicaldoc.com for a quote.}}
 
{{Advice|This guide refers to a basic single-server deployment scenario. <b><u>Please be aware that this procedure is not covered by the standard support contract</u>.</b> <u>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</u>.<br/> In case you want this delicate matter to be handled professionally, please write to sales@logicaldoc.com for a quote.}}
Line 23: Line 23:
 
== Step 3: Run the new container ==
 
== Step 3: Run the new container ==
 
<u>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.</u>
 
<u>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.</u>
* Assuming you release is the 8.9.3, this could be a sample command to run the new container:
+
* 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'''
 
  $ 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.
 
* 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.
Line 29: Line 29:
 
== Step 4: Restore the relevant file in the new contanier ==
 
== 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
 
* Now, with the new container up and running, restore the files backed but from the old system
  $ docker cp context.properties logicaldoc_new:/LogicalDOC/conf/context.properties
+
  $ docker cp conf/. logicaldoc_new:/LogicalDOC/conf
  $ docker cp repository/.  logicaldoc_new:/LogicalDOC/repositor
+
  $ docker cp repository/.  logicaldoc_new:/LogicalDOC/repository
  
 
== Step 4: Rename the containers ==
 
== Step 4: Rename the containers ==
 
* 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]]

Latest revision as of 07:36, 16 August 2024

Sometimes you want to migrate your running Docker container to another more recent image(but same LogicalDOC's application version). 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