Migration of an Installation under GNU/Linux#
This article focuses on the general procedure to migrate an i-doit installation from one GNU/Linux to another one. The migration includes databases as well as files and directories.
Preparation and Assumptions#
Both systems must use the same i-doit version!
In the case of Red Hat-based operating systems, argon2i may have to be installed additionally
You have to observe a few things to guarantee a smooth migration:
- i-doit is installed on both servers in the same version.
- Both systems were created with the idoit-install script.
- Both systems use the same passwords for MariaDB and can be changed afterwards. If not, you can also use the optional steps.
- We do not change the old system so that we can quickly return to the original state if the worst comes to the worst.
- The commands shown are suitable for a current Debian GNU/Linux and should be adapted to the corresponding environment. Blind execution of the commands should be avoided
Preparation of the New System#
First of all, it is necessary to prepare the new systems as far as possible by observing the following:
- The system requirements correspond to the version used, see the Compatibility matrix.
- The system settings have been configured on the new operating system.
Closing Down the Old System#
The old system should not be used productively during the migration process anymore:
- Empty the i-doit address (URL) in the i-doit administration and set it again on the new system.
- Downtimes are annoying, especially unexpected ones. The users of i-doit should have been informed in advance that the installation is moving and during which period it will be unavailable.
- You should deactivate automated access of third-party systems.
- Also cronjobs should be deactivated. In most cases, it is sufficient to comment out the command lines.
-
After the above mentioned points have been completed, you should stop the Apache Webserver:
1
sudo systemctl stop apache2
Move old system#
-
First, the i-doit folder is packed into a file:
1 2
cd /var/www/html zip -rq /tmp/i-doit-migration.zip .
1 2
cd /var/www/html tar -czvf /tmp/i-doit-migration.tar.gz .
-
Dump the databases into a file and pack them with gz:
1
mysqldump -hlocalhost -uroot -p --all-databases | gzip -9 > /tmp/idoit-backup.sql.gz
-
Then transfer the files and the database dump to the new host:
1 2
scp /tmp/i-doit-migration.zip user@newsystem:/tmp/ scp /tmp/idoit-backup.sql.gz user@newsystem:/tmp/
1 2
scp /tmp/i-doit-migration.tar.gz user@newsystem:/tmp/ scp /tmp/idoit-backup.sql.gz user@newsystem:/tmp/
Move to new system#
-
Unzip the files and change to the html folder beforehand:
1 2
cd /var/www/html unzip /tmp/i-doit-migration.zip
1 2
cd /var/www/html tar -xzvf /tmp/i-doit-migration.tar.gz
-
Import database:
1
gunzip < /tmp/idoit-backup.sql.gz | mysql -hlocalhost -uroot -p
-
If the file system rights are no longer correct:
1 2 3 4
cd /var/www/html sudo chown www-data:www-data -R . sudo find . -type d -name \* -exec chmod 775 {} \; sudo find . -type f -exec chmod 664 {} \;
-
i-doit stores internal caches under the
temp/
directory. The contents should be completely removed. When i-doit is used for the first time, the caches are created automatically:1
sudo rm -r temp/*
-
It should be checked whether the .htaccess file has been copied:
1
ls -lha /var/www/html/.htaccess
OPTIONAL: Use other database passwords#
If other passwords are used for the database, the following steps are also necessary. In this example, we use the following access data:
Benutzer | Passwort |
---|---|
System DB user | root |
System DB password | root |
i-doit DB user | idoituser |
i-doit DB password | idoitpass |
-
To establish access to the Admin-Center, the
config.inc.php
must be adapted:1
nano /var/www/html/src/config.inc.php
-
Adjust and save the values under
$g_db_system
foruser
andpass
. - Log in to the Admin-Center via the URL
http://idoiturl/admin
, select the client in the Tenants tab and click on Edit. - Enter the new
Username
and the newPassword
as well asRetype password
in the MySQL settings and save. - Log out of the Admin-Center and log in to i-doit.
Follow-up Work#
- Log into the Admin-Center and check the Licensing and Encryption method.
- Afterwards, you should adapt DNS entries, IP addresses, host names etc., so that i-doit can be accessed as usual.
- Now interfaces to third-party systems can be reactivated. The functions should be checked.
- Reactivate cronjobs and test them.
- Set up backups and test them.
- When the Web GUI reacts as usual and all data are available in i-doit, the migration was successful.
- Doing the usual security measures.