Migration Type: Delta Migrations

Migration Type: Delta Migrations

A "Delta" migration is necessary when you migrate some data now and some data later.

To do a Delta migration, please follow the steps below after you have complete the initial backup and restore.

1.  Create the "Phase 2" Backup

Using Universal Migrator, perform a new backup of the source system.

2.  Copy Result_Ids from "Phase 1" to "Phase 2"

Replace the Database Names
In the following script, replace PHASE1_DB and PHASE2_DB with the names of the respective database names.

If you want to copy the Result_Ids for all tables, simply use the query below.


  1. use [PHASE1_DB]

  2. exec sp_MSforeachtable '


  3. UPDATE

  4. [PHASE2_DB].?
  5. SET
  6. Comment = Phase1.Comment,
  7. Batch_Number = Phase1.Batch_Number,
  8. Batch_Group = Phase1.Batch_Group,
  9. Status_ReferenceCode = Phase1.Status_ReferenceCode,
  10. Status_Description = Phase1.Status_Description,
  11. Status_Date_From = Phase1.Status_Date_From,
  12. Status_Date_Till = Phase1.Status_Date_Till,
  13. Result_Id = Phase1.Result_Id,
  14. Result_ReferenceCode = Phase1.Result_ReferenceCode
  15. FROM
  16. [PHASE1_DB].? Phase1,
  17. [PHASE2_DB].? Phase2
  18. WHERE 1=1
  19. and Phase1.Id = Phase2.Id
  20. and Phase2.Result_Id = ''''
  21. '

 

Or if you want to copy the Result_Ids for one specific table, use the query below:

  1. USE [PHASE2_DB]

  2. UPDATE
  3. [PHASE2_DB].dbo.__M_Matters
  4. SET
  5. Comment = Phase1.Comment,
  6. Batch_Number = Phase1.Batch_Number,
  7. Batch_Group = Phase1.Batch_Group,
  8. Status_ReferenceCode = Phase1.Status_ReferenceCode,
  9. Status_Description = Phase1.Status_Description,
  10. Status_Date_From = Phase1.Status_Date_From,
  11. Status_Date_Till = Phase1.Status_Date_Till,
  12. Result_Id = Phase1.Result_Id,
  13. Result_ReferenceCode = Phase1.Result_ReferenceCode

  14. FROM
  15. [PHASE1_DB].dbo.__M_Matters Phase1,
  16. [PHASE2_DB].dbo.__M_Matters Phase2
  17. WHERE 1=1
  18. and Phase1.Id = Phase2.Id
  19. and Phase2.Result_Id = ''

3.  Restore / Tweak using the "Phase 2" Backup

After the above script runs, the "Phase 2" database will now have Result_Ids in it.  This will allow you to safely restore or tweak records.

    • Related Articles

    • 4.2 - Migration Philosophy: Standard Migrations

      When using the Universal Migrator to perform a data migration, there are three distinct steps to a migration. Data Backup With a Data Backup, you are using the Universal Migrator to pull data out of a legacy system. When this happens, the data is ...
    • 01 - Configuring a Migration Workstation

      Location Matters Please refer to this article for information on where a migration workstation should be provisioned. Best Practice: Choosing the Right Location for a Migration Workstation For Multiple Concurrent Migrations If you intend to do lots ...
    • 02 - Creating a Migration Playbook

      When a surgeon goes into an operating room, they have a written-down plan that describes exactly what they are going to do. This plan provides confidence and assurance that the project will be done correctly and ensures that no step can be lost or ...
    • 01 - Creating a Migration Workspace

      Prior to scoping a migration, you should create a migration workspace for the prospective project on your migration workstation. This folder structure will contain notes and important information about the project that you will add to as you discuss ...
    • 03 - Configuring a Migration Workstation (for Multiple Concurrent Migrations)

      Recommended Location A migration workstation configured this way should be located: in your office or your data center Recommended Specs Before we get started, you should have a modern PC with the following specs or better. Recommended Hardware ...