Difference between revisions of "Server Migration"

From LogicalDOC Community Wiki
Jump to navigationJump to search
 
(11 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
Sometimes you want to migrate your running installation to another server. This How-To describe a plan to migrate a LogicalDOC installation o another machine, please note that this activity is delicate and may lead to data loss.
 
Sometimes you want to migrate your running installation to another server. This How-To describe a plan to migrate a LogicalDOC installation o another machine, please note that this activity is delicate and may lead to data loss.
  
== Migration Notes ==
+
{{Advice|This guide refers to a basic single-server deployment scenario. <b><u>Please be aware that this procedure is not coverded 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. This procedure is not coverded by the standard support contract. In case something goes wrong during the migration process, the support team cannot offer any help.<br/> In case you want this delicate matter to be handled professionally, please write to sales@logicaldoc.com for a quote.}}
+
 
 +
== Assumptions ==
 +
* Both the original system and the new one are the <b>same version</b>.
 +
* Both the original system and the new one use the <b>same database engine</b> (eg: MySQL)
  
 
== Definitions ==
 
== Definitions ==
Line 10: Line 13:
 
*'''/NEWLDOC''': represents the installation path of the migrated installation
 
*'''/NEWLDOC''': represents the installation path of the migrated installation
  
== Assumptions ==
+
== Step 1: Unbind the license from the old system ==
* Both the original system and the new one are the same version.
+
In general your license is bound to a specific hardware, so you have to unbind it before being able to activate the same in another server.
* Both the original system and the new one use the same database engine (eg: MySQL)
+
Please follow the license unbinding guide here: https://docs.logicaldoc.com/en/license-management/license-unbind
  
== Step 1: Install a fresh LogicalDOC in the new server ==
+
== Step 2: Install a fresh LogicalDOC in the new server ==
 
Preparing this new installation, make sure to use the same database engine you used in the old system (eg: MySQL).<br/>
 
Preparing this new installation, make sure to use the same database engine you used in the old system (eg: MySQL).<br/>
 
<u>It is really important to install the same version of LogicalDOC as the old system.</u>
 
<u>It is really important to install the same version of LogicalDOC as the old system.</u>
Line 21: Line 24:
 
*After the end of installation, stop LogicaDOC.
 
*After the end of installation, stop LogicaDOC.
  
== Step 2: Migrate the configuration files ==
+
== Step 3: Migrate the configuration files ==
 
* Copy all the files in '''/OLDLDOC'''/conf into '''/NEWLDOC'''/conf
 
* Copy all the files in '''/OLDLDOC'''/conf into '''/NEWLDOC'''/conf
 +
* Open the file '''/NEWLDOC'''/conf/build.properties and replace all the occurrencies of '''/OLDLDOC''' with '''/NEWLDOC'''
 
* Open the file '''/NEWLDOC'''/conf/context.properties and replace all the occurrencies of '''/OLDLDOC''' with '''/NEWLDOC'''
 
* Open the file '''/NEWLDOC'''/conf/context.properties and replace all the occurrencies of '''/OLDLDOC''' with '''/NEWLDOC'''
* Reconfigurethe connection to the new database, open the file '''/NEWLDOC'''/conf/context.properties and follow these instrucions:
+
* Reconfigure the connection to the new database, open the file '''/NEWLDOC'''/conf/context.properties and follow these instrucions:
 
** Locate the property '''jdbc.url''' and put the connection URL to your new database
 
** Locate the property '''jdbc.url''' and put the connection URL to your new database
 
** Locate the property '''jdbc.username''' and put the new database username
 
** Locate the property '''jdbc.username''' and put the new database username
 
** Locate the property '''jdbc.password''' and put the new database password
 
** Locate the property '''jdbc.password''' and put the new database password
  
== Step 3: Migrate the documents repository ==
+
== Step 4: Migrate the documents repository ==
 
* Open the file '''/OLDLDOC'''/conf/context.properties and locate the property '''store.1.dir''', it references a path we could call '''/OLDPATH'''
 
* Open the file '''/OLDLDOC'''/conf/context.properties and locate the property '''store.1.dir''', it references a path we could call '''/OLDPATH'''
 
* Open the file '''/NEWLDOC'''/conf/context.properties and locate the property '''store.1.dir''', it references a path we could call '''/NEWPATH'''
 
* Open the file '''/NEWLDOC'''/conf/context.properties and locate the property '''store.1.dir''', it references a path we could call '''/NEWPATH'''
Line 36: Line 40:
 
This repository can be big so the time to transfer all the contents to the new server may require a lot of time.
 
This repository can be big so the time to transfer all the contents to the new server may require a lot of time.
  
== Step 4: Migrate the full-text index ==
+
== Step 5: Migrate the full-text index ==
 
* Open the file '''/OLDLDOC'''/conf/context.properties and locate the property '''index.dir''', it references a path we could call '''/OLDPATH'''
 
* Open the file '''/OLDLDOC'''/conf/context.properties and locate the property '''index.dir''', it references a path we could call '''/OLDPATH'''
 
* Open the file '''/NEWLDOC'''/conf/context.properties and locate the property '''index.dir''', it references a path we could call '''/NEWPATH'''
 
* Open the file '''/NEWLDOC'''/conf/context.properties and locate the property '''index.dir''', it references a path we could call '''/NEWPATH'''
 
* Copy all the contents of '''/OLDPATH''' to '''/NEWPATH'''
 
* Copy all the contents of '''/OLDPATH''' to '''/NEWPATH'''
  
== Step 5: Migrate the plugins configurations ==
+
== Step 6: Migrate the plugins configurations ==
 
* Open the file '''/OLDLDOC'''/conf/context.properties and locate the property '''conf.plugindir''', it references a path we could call '''/OLDPATH'''
 
* Open the file '''/OLDLDOC'''/conf/context.properties and locate the property '''conf.plugindir''', it references a path we could call '''/OLDPATH'''
 
* Open the file '''/NEWLDOC'''/conf/context.properties and locate the property '''conf.plugindir''', it references a path we could call '''/NEWPATH'''
 
* Open the file '''/NEWLDOC'''/conf/context.properties and locate the property '''conf.plugindir''', it references a path we could call '''/NEWPATH'''
 
* Copy all the contents of '''/OLDPATH''' to '''/NEWPATH'''
 
* Copy all the contents of '''/OLDPATH''' to '''/NEWPATH'''
  
== Step 6: Migrate the database ==
+
== Step 7: Migrate the database ==
 
* Make a dump file of the old database, if you are using MySQL, execute this command:  
 
* Make a dump file of the old database, if you are using MySQL, execute this command:  
 
  $ mysqldump -u '''username''' -p'''password''' --add-drop-database '''logicaldoc''' > logicaldoc.sql
 
  $ mysqldump -u '''username''' -p'''password''' --add-drop-database '''logicaldoc''' > logicaldoc.sql
Line 52: Line 56:
 
  $ mysql -u '''username''' -p'''password''' '''logicaldoc''' < logicaldoc.sql
 
  $ mysql -u '''username''' -p'''password''' '''logicaldoc''' < logicaldoc.sql
  
== Step 7: Start LogicalDOC ==
+
== Step 8: Start LogicalDOC ==
* Start LogicalDOC in the new server and chack that all is working properly
+
* Start LogicalDOC in the new server and check that all is working properly
  
 
[[Category: Migration]]
 
[[Category: Migration]]

Latest revision as of 08:00, 12 April 2021

Sometimes you want to migrate your running installation to another server. This How-To describe a plan to migrate a LogicalDOC installation o another machine, 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 coverded 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 original system and the new one are the same version.
  • Both the original system and the new one use the same database engine (eg: MySQL)

Definitions

  • /OLDLDOC: represents the installation path of the installation to migrate
  • /NEWLDOC: represents the installation path of the migrated installation

Step 1: Unbind the license from the old system

In general your license is bound to a specific hardware, so you have to unbind it before being able to activate the same in another server. Please follow the license unbinding guide here: https://docs.logicaldoc.com/en/license-management/license-unbind

Step 2: Install a fresh LogicalDOC in the new server

Preparing this new installation, make sure to use the same database engine you used in the old system (eg: MySQL).
It is really important to install the same version of LogicalDOC as the old system.

Step 3: Migrate the configuration files

  • Copy all the files in /OLDLDOC/conf into /NEWLDOC/conf
  • Open the file /NEWLDOC/conf/build.properties and replace all the occurrencies of /OLDLDOC with /NEWLDOC
  • Open the file /NEWLDOC/conf/context.properties and replace all the occurrencies of /OLDLDOC with /NEWLDOC
  • Reconfigure the connection to the new database, open the file /NEWLDOC/conf/context.properties and follow these instrucions:
    • Locate the property jdbc.url and put the connection URL to your new database
    • Locate the property jdbc.username and put the new database username
    • Locate the property jdbc.password and put the new database password

Step 4: Migrate the documents repository

  • Open the file /OLDLDOC/conf/context.properties and locate the property store.1.dir, it references a path we could call /OLDPATH
  • Open the file /NEWLDOC/conf/context.properties and locate the property store.1.dir, it references a path we could call /NEWPATH
  • Copy all the contents of /OLDPATH to /NEWPATH

This repository can be big so the time to transfer all the contents to the new server may require a lot of time.

Step 5: Migrate the full-text index

  • Open the file /OLDLDOC/conf/context.properties and locate the property index.dir, it references a path we could call /OLDPATH
  • Open the file /NEWLDOC/conf/context.properties and locate the property index.dir, it references a path we could call /NEWPATH
  • Copy all the contents of /OLDPATH to /NEWPATH

Step 6: Migrate the plugins configurations

  • Open the file /OLDLDOC/conf/context.properties and locate the property conf.plugindir, it references a path we could call /OLDPATH
  • Open the file /NEWLDOC/conf/context.properties and locate the property conf.plugindir, it references a path we could call /NEWPATH
  • Copy all the contents of /OLDPATH to /NEWPATH

Step 7: Migrate the database

  • Make a dump file of the old database, if you are using MySQL, execute this command:
$ mysqldump -u username -ppassword --add-drop-database logicaldoc > logicaldoc.sql
  • Move the dump file logicaldoc.sql in the new server and restore it in the new database, if you are using MySQL, execute this command:
$ mysql -u username -ppassword logicaldoc < logicaldoc.sql

Step 8: Start LogicalDOC

  • Start LogicalDOC in the new server and check that all is working properly