Introduction
Scope: Applies to these projects:
- ServiceNow->DB
- ServiceNow->ServiceNow
- DB->DB
The Source Deletion tab on Form Mappings is only enabled for migration projects in scope. The Source Deletion functionality is provided to delete records from the source server that have been successfully migrated to the target server. If any records fail to migrate to the target then they cannot be deleted.
All records selected in the current project for migration (defined under Source Filtering) will be selected for deletion if the migration is successful and the Source Delete checkbox: Delete Source Records After Migration is selected.
Source Deletion from a Database Server
The options avalilable for deletion from a database server are straightforward. Source deletion can either be enabled or disabled. It is always disabled by default.
Precision Bridge will perform a check on the target server to see if the record is there - this will be based on a matching primary key value. Note that deletion from tables that do not have a primary key, or have a a composite primary key is not currently supported. If the record is not found on the target, it will not be deleted from the source and this will be reported as an error.
Click the Apply button to confirm any changes to source deletion options.
Source Deletion from a ServiceNow Server
There are additional options when deleting from a ServiceNow server aimed to:
- Allow the user to delete any related auditing and data recovery records (to maximize space savings)
- Allow prevention of accidental cascade deletion of child records and attachments.
The sections below will explain these options.
Click the Apply button to confirm any changes to source deletion options.
Protection from ServiceNow Cascade Delete of Related Records
In ServiceNow, when a parent record is deleted all its attachments and child records where cascade deletion is configured are automatically deleted. There is nothing Precision Bridge can do to prevent this. However, as a safeguard, the deletion is prevented by default if any related records exist in related tables where cascade deletion is applied. All cascade delete tables related to the source table for the form mapping are listed in the table on the Source Deletions tab (as shown above).
If you want to change the default behaviour to allow deletions even when related records exist in the Cascade Delete tables, select one or more of the cascade delete tables from the list then change the option to either Delete Source Record, Record Warning OR Delete Source Record. You can use the Set Action For Selected Rows field to perform multiple row updates like this:
Click on the Update button to apply the change to the selected records.
Protection from ServiceNow Cascade Delete of Attachments
Attachments will also be automatically deleted with the parent record, so to avoid accidental loss of unmigrated attachments, Precision Bridge can check that they have been migrated before deleting the parent record. To control this behaviour choose the required setting from the drop-down on the field Action if Un-migrated Attachments Exist like this:
See separate article on migrating attachments to an Archive Database.
Cascade Deletion Recommendations
Note that checking for existing related records can take some time, particularly if many child tables are configured to be cascade deleted. Precision Bridge needs to check for these, even if these tables are not in use in your organisation. Having a very large number of cascade deletes configured will slow performance and can in some cases result in timeouts during the delete operation that will terminate execution.
It is therefore recommended to select the 'Delete Source Record' option for any records that you are sure are either not present or unimportant to you. Select the 'Do Not Delete Source Record' option only if you want to be sure of preventing data loss for this table.
The recommended best practice approach to a migration where both parent and child records are being migrated and then deleted is to create separate Form Mappings for the child records to run before the parent record mapping to migrate and delete the records in the related cascade delete tables first. Then when the parent Form Mapping is executed, any related cascade delete records will already have been migrated and deleted, allowing the source record to be deleted as well.
Deleting ServiceNow Audit Records and Delete Recovery Audit Records
In addition to deleting the source record, you can also configure Source Deletions to remove the associated Audit Records (sys_audit) and Delete Recovery Audit Records (sys_audit_delete).
To set either of these options, use the corresponding checkboxes on the Source Deletions tab:
Warning: If you select the option to Remove Delete Recovery Audit Records then the source record cannot be restored and will only be available in the Target. Once deleted, this action cannot be undone.
Similarly, the Audit Records and Delete Recovery Audit Records can be removed from the related Cascade Delete records when they are deleted. To enable these options select the corresponding checkboxes on the Source Deletions tab:
Note that these options cannot be selected unless the corresponding option has been selected for Audit records and Delete Recovery Audit Records.
Comments
0 comments
Please sign in to leave a comment.