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 ADSelfService Plus?

                    • Related Articles

                    • Migration of SCP from one server to another

                      1. Stop the application on the production server. 2. Take a trimmed backup of the application (backup without attachments) if you are using the default PgSQL database. If you are using MSSQL, you can take a SQL backup (.bak). 3. Download and install ...
                    • 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, |, ...
                    • Syntax for SDP MSP migration to Linux

                      While migrating to different database you can use backupdataold.bat. Here backup will be in .data format and this can be restored in across DB platform. Note: Backup from taken from a particular build can be restored only on the same build. Example: ...
                    • How to migrate data from SDP to SDP MSP.

                      Below are the only details which can be exported from SDP and imported to SDP MSP application. 1) You can export request data from ServiceDesk Plus (SDP) using XLS format. Requests -> Goto Admin -> Reports -> New custom report -> Tabular reports -> ...
                    • How do I restore the backup data?

                      NOTE: For builds > 10.6 While migrating to different database you can use backupdataold.bat / backupdataold.sh. Here backup will be in .data format and this can be restored in across DB platform. While restoring .data file we have to use below ...