Which tables are truncated by the OpsConsole in a Copy to Replace operation

Version 1

    Details

    Which tables are truncated by the OpsConsole in a Copy to Replace operation? 


    Resolution

    When using the Copy to Replace option in the OpsConsole the <pathToOpsConsole>\App_Data\ScrubNewTenant.sql file is run it will truncate the workflow instances amongst other things.

    -- active sessions
    truncate table dbo.Frs_ops_session_secondary_key
    go
    -- Escalation and Workflow
    truncate table dbo.Frs_ops_workflow_event
    truncate table dbo.Frs_ops_workflow_event_error
    truncate table dbo.Frs_ops_workflow_event_subs
    truncate table dbo.Frs_ops_workflow_heart_beat
    truncate table dbo.Frs_ops_workflow_timer
    truncate table dbo.Frs_data_escalation_watch
    truncate table dbo.Frs_data_workflow_instance
    truncate table dbo.Frs_data_workflow_history
    delete dbo.Frs_def_businessrules where IsVisible = 0
    delete dbo.Frs_data_objectinstancetriggers where IsVisible = 0

    -- Email Service Integration
    truncate table dbo.Frs_ops_email_incoming_queue
    truncate table dbo.Frs_ops_email_incoming_queue_error

    -- DSM Integration
    truncate table dbo.Frs_data_dsm_inst_params
    truncate table dbo.Frs_data_dsm_provision_request
    truncate table dbo.Frs_data_dsm_software
    truncate table dbo.Frs_data_dsm_software_request
    truncate table dbo.Frs_data_dsm_sync_request
    truncate table dbo.Frs_def_dsm_inst_params
    truncate table dbo.Frs_def_dsm_installation_state
    truncate table dbo.Frs_def_dsm_maint_window
    truncate table dbo.Frs_def_dsm_platform
    truncate table dbo.Frs_def_dsm_software
    truncate table dbo.Frs_def_dsm_software_cat_assn
    truncate table dbo.Frs_def_dsm_software_set_comp
    truncate table dbo.Frs_ops_dsm_integration
    truncate table dbo.Frs_data_integration_log
    truncate table dbo.Frs_ops_integration_queue

    -- TenantSettingLicenseUsage
    truncate table dbo.TenantSetting
    truncate table dbo.LicenseUsage

    -- Frs_data_objectinstancetriggers
    truncate table dbo.Frs_data_objectinstancetriggers

    -- Frs_ops_workflow_event_audit
    truncate table dbo.Frs_ops_workflow_event_audit

    -- def_translations_save2012_3
    truncate table dbo.def_translations_save2012_3

    -- frs_ops_email_incoming_queue_Audit
    truncate table dbo.frs_ops_email_incoming_queue_Audit

    -- ootb_frs_def_translations
    truncate table dbo.ootb_frs_def_translations

    -- saved_frs_def_translations
    truncate table dbo.saved_frs_def_translations

    -- packages
    truncate table dbo.Frs_ops_package_item
    truncate table dbo.Frs_ops_master_package_mapping
    truncate table dbo.Frs_ops_Package_Aspect
    truncate table dbo.Frs_ops_package

    You can additional tick the "Delete audit, log, change log and history data" this will run the <pathToOpsConsole>\App_Data\ScrubAuditLogData.sql. Below is what is currently in that file

    truncate table dbo.Logs
    truncate table dbo.Frs_ops_logon_history
    truncate table dbo.Frs_ops_gbu_pipeline_history
    truncate table dbo.Frs_ops_metadata_history
    truncate table dbo.Frs_ops_upload_cache
    truncate table dbo.Journal
    delete dbo.LDAPImportLog where CreatedDateTime < (select MAX(CreatedDateTime) from dbo.LDAPImportLog)
    truncate table dbo.Frs_ops_change_log
    truncate table dbo.Frs_ops_change_log_txid
    delete dbo.Frs_ops_project where RecId <> '8ECC68C5794C442180CDC456DBD6AA67'