Data Migration - ESM Build

Data Migration - ESM Build

Requirement:
All the tickets that are assigned to specific sites has to be moved to a corresponding instances that are built for the sites.
For example: Site A ticket from IT instance should be moved to Instance A.
The tickets once moved should be closed in the IT instance. The tickets that are moved should have all the fields to be migrated along with the additional fields in the new instance.
Also, the url for the same ticket in the IT instance should be added as a note in the freshly created ticket so that one can check the history details if required.


Script Requirements:
1.  UDF Fields have to be mapped from the source portal to the target portal
2.  Target portal should have similar template names, status, priority, urgency and other basic request properties names as the Source portal.
3.  Source portal request link will be added as a note to the Target portal.

Steps to Configure:
1.  Update the target Portal ID, the UDF field mappings, URL and TechnicianKey in the script.

2.  Execute the below query in the source portal and export the ticket list as a csv file.
Note:  Update the site name as per your instance
Query:
SELECT wo.helpdeskid   "portalid",
       wo.workorderid  AS "workorderid",
       sdo.NAME  AS "site"
FROM   workorder wo
       LEFT JOIN sitedefinition siteDef ON wo.siteid = siteDef.siteid
       LEFT JOIN sdorganization sdo ON siteDef.siteid = sdo.org_id
WHERE  wo.isparent = '1' and  sdo.NAME='<Site_Name>'

3.  Update the exported file name in the script.  In my instance, its 1649406192529.csv

4.  Also, update the URL, TechnicianKey and the UDF_Mappings in the script file.  Refer the below screenshot.



6.  Since this is a one time activity, we can execute the same from the command prompt itself.
Make sure both the csv file and the python files are in the same folder.  Open command prompt in the file location folder, and use the below command to invoke the script:  py dataMigration_addRequests.py

Note: 
  1. The script would write all the success and failure Ticket ids to a file.
    1. Failed List will be saved in a csv file with file name: <target_portal_id>_failed_records.csv
    2. Success List will be saved in a csv file with file name: <target_portal_id>_success_records.csv
  2. We will be updating the created time of the target request with that of the source request after the ticket creation at the target portal.  

                  New to ADManager Plus?

                    New to ADSelfService Plus?

                      • Related Articles

                      • Migration failure for Postgres Database with a blank space in it

                        Trace : \ManageEngine\ServiceDesk\Patch\AdventNet_ManageEngine_ServiceDesk_Plus-14.2.0-SP-1.0.0\SERVICEDESK\PreInstall\pg_migrate\pgsql_old\bin\pg_dumpall.exe", -U, postgres, -p, 65433, -h, 127.0.0.1, -r, -w, |, ...
                      • How to restore your data in ServiceDesk Plus

                        1. Stop the ManageEngine ServiceDesk Plus service from the Services console(services.msc).   2. Click the Windows icon and select Command Prompt (Admin).   3. Go to Bin directory and run restoreData.bat   4.Browse to the backup file from backup ...
                      • Upgrade failure when migrating privileges for removed functions

                        LOG Trace : 03.08.2023 12:50:36 [com.zoho.postgres.migrate.DumpMigration] [SCHWERWIEGEND] : Problem during upgrade.com.zoho.postgres.exception.MigrationFailureException: Restoration failed for PRE_DATA at ...
                      • Migration failure after 9414- ChangeConfigurations table

                        Error Trace: [SYSERR] [INFO] : org.xml.sax.SAXException: Already a row with the same set of primary keys found in this object, this row <ChangeConfigurations CONFIG_ID="1" CATEGORY="GlobaEditOnAllStages" PARAMETER="IsCOAllowed" PARAMVALUE="false" ...
                      • Zia approval prediction failure even with customized data

                        Zia approval prediction is not working as expected even though the data is given under customized data. Fix: The customized model will be considered for the prediction at first and then if it fails to predict, the default model will be considered. ...