Migrating an installation on GNU/Linux#
In this article, we describe the general procedure for migrating an i-doit installation from one GNU/Linux system to another. The migration includes both the databases and the files and directories.
Preparations and Assumptions#
Both systems must use the same i-doit version!
On Red Hat based operating systems, argon2i may need to be installed additionally
A few things need to be considered to ensure 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; these can be changed afterwards. If not, also use the optionally steps.
- We do not modify the old system so that we can quickly return to the original state if needed.
- The commands shown are suitable for a current Debian GNU/Linux and should be adapted to the respective environment. Blindly executing commands should be avoided.
Prepare New System#
First, the new system should be prepared as much as possible:
- The system requirements match the version in use; see the compatibility matrix.
- Customized system settings have been configured.
Decommission Old System#
The old system should no longer be used productively during the migration:
- Clear the i-doit address (URL) in the i-doit Administration and set it again on the new system.
- Downtimes are annoying, especially unexpected ones. Users of i-doit should be informed in advance that the installation is being migrated and during which period it will be unavailable.
- Automated access from third-party systems should be deactivated.
- Cron jobs should also be deactivated. It is usually sufficient to comment out the command lines.
-
After ensuring the above points, the Apache web server should be stopped:
1sudo systemctl stop apache2
On the Old System#
-
First, pack the i-doit folder 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 . -
Save the databases to a file ("dump") and compress with gz:
1mysqldump -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/
Migration to New System#
-
Extract files after switching to the html folder:
1 2
cd /var/www/html unzip /tmp/i-doit-migration.zip1 2
cd /var/www/html tar -xzvf /tmp/i-doit-migration.tar.gz -
Import database:
1gunzip < /tmp/idoit-backup.sql.gz | mysql -hlocalhost -uroot -p -
If file system permissions 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 in the
temp/directory. The contents should be completely removed. The caches are automatically created on first use of i-doit:1sudo rm -r temp/* -
It should be checked whether the .htaccess file was copied:
1ls -lha /var/www/html/.htaccess
OPTIONAL: Use Different Database Passwords#
If different passwords are used for the database, the following additional steps are necessary. In this example, we use the following credentials:
| User | Password |
|---|---|
| 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.phpmust be modified:1nano /var/www/html/src/config.inc.php -
Adjust and save the values under
$g_db_systemforuserandpass. - Log in to the Admin Center via the URL
http://idoiturl/admin, select the tenant in the Tenants tab, and click Edit. - Enter the new
Usernameand newPasswordas well asRetype passwordin the MySQL settings and save. - Log out of the Admin Center and log in to i-doit.
Post-Processing#
- Log in to the Admin Center and check the Licensing and the Encryption method.
- DNS entries, IP addresses, hostnames, etc. should be adjusted afterwards so that i-doit is accessible as usual.
- Interfaces to third-party systems can now be reactivated. The functions should be tested.
- Cron jobs should be reactivated and tested.
- Backups should be set up and tested.
- If the WebGUI also responds as usual and all data in i-doit is apparently present, the migration was successful.
- Perform standard security measures.