Zephyr Windows to Linux Migration

Table of Contents


Zephyr Windows to Linux Migration:

Zephyr Windows to Linux Migration lets you migrate your data from a Windows environment to a Linux environment. This is a process that should be performed before upgrading to 6.3. After 6.2, a Windows backup file needs to be restored in Linux (a MySQL DB). Users need to connect to the itcc database and run the following SQL to rename the table.

rename table backupoldidvsnewid to backupOldIdVsNewId;


How to Restore a Windows Backup File to Linux

1.  Take a backup from the Windows environment without any attachments 

  • You take the backup without attachments because the folders from a Windows backup file do not untar the correct directory structure within a Linux environment.

2. Create a tar.gz file of the attachments if need be or you can use 7-zip (tar then a gzip).

3. Install the same Zephyr version on your Linux environment.

4. Stop the Zephyr server.

5. Untar itcc.bak and the dversion.bak from the Windows backup.

tar -zxvf zephyrbackup_4.6_8405_2014-09-30_14130403.tar.gz

6. Convert the appropriate tables to the uppercase name where necessary. It can be downloaded directly into Linux using wget 

wget http://www.yourzephyr.com/customers/linux/itcc.sh
wget http://www.yourzephyr.com/customers/linux/dversion.sh

How to use the scripts

6.1 Save both the sh files to the same directory as the directory as the itcc.bak and dversion.bak.
6.2 Provide the permissions to the sh files.
chmod +x itcc.sh
chmod +x dversion.sh
6.3 Run sh files.
./itcc.sh
./dversion.sh dversion.bak

7. Connect to MySQL.

7.1 Drop the itcc and dversion.
drop database itcc;
drop database dversion;
7.2 Create the itcc and dversion.
create database itcc;
create database dversion;
8. Manually restore the itcc and dversion from the converted files.
mysql -uroot -proot itcc < itcc.bak
mysql -uroot -proot dversion < dversion.bak
9. Change the hotback path in the itcc and connecting to MySQL.
USE `itcc` ;
UPDATE `preference_system` SET `value` = '${ZEPHYR_HOME}/backup_restore/bin/hotBackup.sh' WHERE `name` = 'backup.script.path';
10. Untar the attachments to the zephyrdata folder.
localhost:/opt/zephyr/zephyrdata # tar -zxvf /home/admin/Documents/WindowsBackupToBeMigratedToLinux/attachment.tar.gz
11. Start Zephyr.

To manually change the table names in MySQL directly after restoring itcc and dversion:

Use itcc;
RENAME TABLE qrtz_blob_triggers TO QRTZ_BLOB_TRIGGERS, qrtz_calendars TO QRTZ_CALENDARS, qrtz_cron_triggers TO QRTZ_CRON_TRIGGERS, qrtz_fired_triggers TO QRTZ_FIRED_TRIGGERS, qrtz_job_details TO QRTZ_JOB_DETAILS, qrtz_job_listeners TO QRTZ_JOB_LISTENERS, qrtz_locks TO QRTZ_LOCKS, qrtz_paused_trigger_grps TO QRTZ_PAUSED_TRIGGER_GRPS, qrtz_scheduler_state TO QRTZ_SCHEDULER_STATE, qrtz_simple_triggers TO QRTZ_SIMPLE_TRIGGERS, qrtz_triggers TO QRTZ_TRIGGERS, qrtz_trigger_listeners TO QRTZ_TRIGGER_LISTENERS;

Use dversion;
RENAME TABLE jackrabbit_thed_binval TO JACKRABBIT_THED_BINVAL, jackrabbit_thed_bundle TO JACKRABBIT_THED_BUNDLE, jackrabbit_thed_names TO JACKRABBIT_THED_NAMES, jackrabbit_thed_refs TO JACKRABBIT_THED_REFS, jackrabbit_version_binval TO JACKRABBIT_VERSION_BINVAL, jackrabbit_version_bundle TO JACKRABBIT_VERSION_BUNDLE, jackrabbit_version_names TO JACKRABBIT_VERSION_NAMES, jackrabbit_version_refs TO JACKRABBIT_VERSION_REFS;

How to Migrate a Windows Instance to Linux

1.  Take a backup of the database (itcc and dversion).

MySQL Backup
mysqldump.exe –e –u[user name] -p[password] -h[host name] [database name] > C:\[filename].sql

2. Take a backup of the attachment folder. The attachment folder can be located from the following:

  • '{Zephyr Dir}/zephyrdata'

3. Within Linux, create the database (itcc and dversion).

4. Restore the backup taken from Step 1 (both the itcc and dversion).

mysql –u[user name] -p[password] -h[host name] [database name] < C:\[filename].sql

5. Run the following query.

ALTER TABLE `qrtz_simprop_triggers` RENAME QRTZ_SIMPROP_TRIGGERS;
ALTER TABLE `qrtz_simple_triggers` RENAME QRTZ_SIMPLE_TRIGGERS;
ALTER TABLE `qrtz_scheduler_state` RENAME QRTZ_SCHEDULER_STATE;
ALTER TABLE `qrtz_paused_trigger_grps` RENAME QRTZ_PAUSED_TRIGGER_GRPS;
ALTER TABLE `qrtz_locks` RENAME QRTZ_LOCKS;
ALTER TABLE `qrtz_job_history` RENAME QRTZ_JOB_HISTORY;
ALTER TABLE `qrtz_job_details` RENAME QRTZ_JOB_DETAILS;
ALTER TABLE `qrtz_fired_triggers` RENAME QRTZ_FIRED_TRIGGERS;
ALTER TABLE `qrtz_cron_triggers` RENAME QRTZ_CRON_TRIGGERS;
ALTER TABLE `qrtz_calendars` RENAME QRTZ_CALENDARS;
ALTER TABLE `qrtz_blob_triggers` RENAME QRTZ_BLOB_TRIGGERS;
ALTER TABLE `qrtz_triggers` RENAME QRTZ_TRIGGERS;
 
 
  
// Run this Query If User is In 6.3 with the above Query
  
ALTER TABLE `backupoldidvsnewid` RENAME backupOldIdVsNewId ;

6. Afterwards, install the Zephyr Standalone instance by passing the following parameter:

zephyr_xxx_xx.sh -VzSkipStartupData=true

7. Once the installation is complete, restore the backup of the zephyrdata taken in Step 2.

Additional Questions:

For any questions, please contact Zephyr Support.