Sample of using Microsoft Data Migration Utility with ‘Createdon’ fix
More and more companies are moving from on-premise to online and one of the big questions that everyone asks, how do we migrate data to online?
There are many solutions like using third party software like Scribe Software, SSIS solutions and some companies have developed their own tool for migrating data.
This blog post isn’t about which solution is best, I want to show you an tool that is often overlooked and that tool is ‘Data Migration Utility’ which is included in CRM SDK by Microsoft.
One issue using this tool is that it don’t set the ‘Created On’ date same as in the source system, createdon date will be date and time when it imports data into CRM.
There is an quick fix to this problem, continue to read my sample to find out.
Requirement before migrating is that your CRM Online needs to have same fields that you want to import.
If your system is customized, one of the options is that you can do in-place upgrade to CRM 2016 and copy customization/solution to CRM Online.
This tool allows you to select which entities and fields to migrate, you don’t need to migrate everything if you don’t need it.
Another cool feature, it will also migrate GUID’s (globally unique identifier for each record)
For this sample, I will migrate ‘Accounts’, same method can be used for different entities.
Step 1: Stat migration utility by clicking on DataMigrationUtility.exe which is located in SDK folder, path is SDKToolsConfigurationMigration
SDK can be downloaded from this link: CRM 2016 SDK
Step 2: Select ‘Create schema’ and click on ‘Continue’
Step 3: Connect to the system where you want to migrate data from, in this sample, I will use ‘Office 365’ and click ‘Login’
Step 4: Once you are connected, select the ‘Default Solution’, entity ‘Account’ and click on ‘Add Entity’, it will add all of the fields for ‘Account’ entity’.
Step 5: Click ‘Save and Export’
Step 6: Type ‘AccountSchema’ and save the file
Step 7: You will asked if you want to export data, click ‘Yes’
Step 8: Click on the three dots ‘…’ for ‘Save to data file’
Step 9: Type ‘Account_data’ and save the file
Step 10: Click on ‘Export data’
Step 11: When it has completed, click on ‘Exit’
Step 12: Select ‘Import’ and then click on ‘Continue’
Step 13: Select ‘Office 365’ to connect to CRM Online and click on ‘Login’
Step 14: Click on the three dots ‘…’, select ‘Account_data.zip’ file that you saved and click on ‘Import Data’ (If you need ‘Created On’ to be same then go to step 15 and then back here)
Step 14: When it is completed, click on ‘Exit’. You data is now imported
If you look in CRM Online and select ‘Created On’ in advanced find, you will see that date and time is current date and time, if this is an issue for you then you need to delete imported data and do step 16 before ‘Step 14’
Next couple of steps will show you how to set same ‘Created On’ as in your source system.
Step 15: Open the folder where you have saved ‘Account_data.zip’, right click on the file and select ‘Extract to account_data’
Step 16: Open the folder ‘account_data’, select file ‘data.xml’, right click on it and select ‘Edit with Notepad++’
If you dont have Notepad++ installed, download it and you will thank me later.
Click here to download
Step 17: On the menu toolbar, click on ‘Search’ and then ‘Replace’
For ‘Find what’, type ‘createdon’
For ‘Replace with’, type ‘overriddencreatedon’
Select ‘Match whole word only’, ‘Match case’ and ‘Wrap around’
When ready, click on ‘Replace all’
Step 18: Close ‘Replace’ window, click on ‘Save’ and close ‘Notepad++’
Step 19: Open the folder again where you have extracted ‘account_data’, select all files, right click and select ‘Send to’ -> ‘Compressed (zipped) folder’
Step 20: Rename the file to ‘account_data_overridecreatedon’ and use this file to import for step 14
That’s it, you can test the tool for yourself and decide if it will meet your requirements for migrating.