Migration from Windows to Linux
This article describes how to migrate your i-doit installation from Windows to GNU/Linux -- without extended downtime and without data loss.
Preparations and Assumptions#
Both systems must be on the same i-doit version!
Before you start:
- Inform users -- Notify all colleagues in advance about the migration and the planned downtime.
- Identify interfaces -- Which third-party systems (Nagios, ((OTRS)) Community Edition, additional) access i-doit? Deactivate data access during the migration, running Tasks, Backups and monitoring.
- Windows side -- This example assumes a XAMPP setup (Apache Friends) . In the following, we use "MySQL" also for MariaDB. Configuration adjustments should be transferred to the new system.
- Linux side -- The new system must be prepared and all system requirements and settings must be fulfilled. DNS, SMTP, and LDAP/AD must be reachable.
- Credentials -- Have the passwords for the MySQL system user (
root) and the i-doit user (idoit) ready.
Export Data from Windows#
- Stop Apache -- Shut down the web server so no requests arrive. MySQL continues running.
- Back up files -- Compress the i-doit directory (e.g.
C:\xampp\htdocs\) asi-doit.zip. -
Export databases -- Open the command prompt, navigate to
C:\xampp\mysql\bin\and execute:1mysqldump.exe -uidoit -p --databases idoit_system idoit_data > i-doit.sql -
Stop MySQL -- End the MySQL process.
Migrate Data to GNU/Linux#
Copy the ZIP file and the SQL file to the new server (e.g. per WinSCP). Connect via SSH (e.g. Putty) and work on the command line. Apache, MySQL, and PHP are already installed and configured.
Database#
- Import the database:
1mysql -uroot -p < i-doit.sql
If you receive this error message when importing the database "Can't create table \idoit_data.\table_name (errno: 140 "Wrong create options")". The solution can be found HERE#
-
Set up the i-doit user:
1mysql -uroot -pExecute the following SQL commands:
1 2
grant all privileges on idoit_system.* to idoit@localhost identified by 'mypasswd'; grant all privileges on idoit_data.* to idoit@localhost identified by 'mypasswd';Test the connection with the new credentials:
1 2
mysql -uidoit -p use idoit_system; -
Check the tenant credentials:
1select * from isys_mandator; -
Check for absolute Windows paths in the database (e.g.
system.dir.file-uploadandsystem.dir.image-uploadinisys_settings):1select * from isys_settingsRelative paths like upload/files/ and upload/images/ are legitimate.
-
Exit the MySQL client with
CTRL+Dorexit;.
Files#
-
Extract the ZIP file to the target directory (e.g.
/var/www/html/):1sudo unzip i-doit.zip -
Set permissions and clean up:
1 2 3 4 5
sudo chown www-data:www-data -R . sudo find . -type d -name \* -exec chmod 775 {} \; sudo find . -type f -exec chmod 664 {} \; sudo chmod 774 controller tenants import updatecheck *.sh sudo rm -r temp/*If necessary, delete files that still originate from the XAMPP installation.
Now test whether i-doit is accessible in the browser via the new URL. If not, analyze the previous steps for errors.
Cron Jobs#
Transfer your Windows tasks to Linux cron jobs. These are typically recurring tasks of the CLI. If you have not set up any tasks yet, do so now.
Post-Processing#
- Perform tests and reactivate the interfaces to third-party tools.
- Make sure that the backups are running.
- Inform all colleagues that the IT documentation is available again.
The actual migration (without preparation and post-processing) usually takes no longer than two hours.