In this chapter, you will explore one of the daunting tasks of Dynamics 365: data migration. The majority of projects that you will undertake will require some level of data migration mainly because your clients will have been working with some legacy system and they will want the legacy data on the new system in order to continue their operations effectively and efficiently. In most cases, the success of the project depends on the data migration. That is, it is only after you migrate the data that you will get to see how the system that you designed and developed is performing. Needless to say, this activity impacts every stakeholder, from the development team to the end users.
Since this is a sensitive task, it must be preplanned so you can allocate resources accordingly. For instance, some clients might provide you with data dumps in a certain format, such as XML or CSV. To begin with, experts will have to analyze these formats carefully. In other scenarios, you will get access to your customer’s back-end data stores or databases to extract the data. Before doing any data analysis or extraction, you must first design and develop a proper strategy for the data migration, and the scope of the strategy will depend on the complexity of the data migration. Let’s look at how you can do this.
Data Migration Strategy
- 1.
Assemble a team of experts. For this tedious task, based on the scope and the complexity, you must assemble a task force of experts including database administrators, database developers, testers, analysts, and so on.
- 2.
Format the data provided to you. As mentioned earlier, the data provided will be some form of file format, or you will be given access to the legacy system’s data stores. Based on this, you will have to decide on the data analysis phase.
- 3.
Identify the data required. In most scenarios, all the data in the data dump is not required, and a thorough analysis of the existing data is a must. During this, you must identify the master data and the transaction data.
- 4.
Once the data analysis is over, you must create a data map that illustrates where the source data should be at the Dynamics 365 destination.
- 5.
Apply any transformation required. Sometimes you will have to transform the data before you put it into Dynamics 365. This involves converting data into a format that is acceptable by Dynamics 365.
- 6.
Decide on the technology or the mechanism to move the data. There are many options available, and we will discuss them at a high level in this chapter. Since you are migrating to Dynamics 365 online, you cannot use SQL scripts. But the most popular and stable option is to use SQL Server Integration Services. There are third-party tools such as KingswaySoft, Scribe, and CozyRoc that are ideal for this task.
- 7.
Develop the scripts to migrate the data. If you are using a third-party package like KingswaySoft, there are Dynamics 365 connectors that you can use and easily create the connections from source to destination, meaning that there are several different sources and destinations.
- 8.
You should also give top priority for executing and business process–related workflows. That is, if there are any workflows that need to be triggered on the transaction data, decide when to execute them. These SSIS packages are capable of executing workflows on data.
- 9.
Finally comes the testing cycle. This is where the testers can find bugs in the implementation. Your developers should be available for fixing any issues identified by the testers.
With these steps you can successfully develop a data migration strategy, but if you are migrating from a Dynamics CRM on-premise instance, you need to follow a different path. Based on the system that you are on, you need to move to Dynamics 365 on-premise by applying the relevant upgrades. Only then can you move the on-premise instance to the online version. This is known as Microsoft FastTrack for Dynamics 365. In the next section, I will give a brief introduction to this process.
Microsoft FastTrack for Dynamics 365
- 1.
Move the on-premises CRM to the Azure infrastructure.
- 2.
Apply the updates and convert it to a state acceptable for Dynamics 365.
- 3.
Push the CRM instance to the Dynamics 365 for Customer Engagement organization.
This tool and process will support databases up to SQL Server 2012.
You can migrate only the managed solution; therefore, if you have any unmanaged solutions, you must convert them.
Facilitate user migrations and audit log migrations.
The tool also performs security vulnerability check in the databases and with associated extensions.
This tool will not solve any upgrade issues, and keep in mind that the upgrade is a multistep process.
You cannot do any selective data migration, and it will not solve any third-party integrations.
It will also not fix any security issues.
- 1.
Provision the CRM instance in Azure.
- 2.
Apply the validation services.
- 3.
Promote the instance to CRM 2013.
- 4.
Promote the instance to CRM 2015.
- 5.
Promote the instance to CRM 2016.
- 6.
Perform a database validation process.
- 7.
Push to Dynamics 365 online.
You must go through a set of steps like these based on the on-premise version that you are in. The FastTrack approach is guided and managed through FastTrack or solution architecture CXP teams. Nominations for the FastTrack program are accepted through the FastTrack portal: https://www.microsoft.com/microsoft-365/partners/fasttrack . Once the nomination is approved, a FastTrack engineer will be assigned to you, and they will work with you through the end of the migration process. You can find more about the program at https://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2016/admins-customizers-dynamics-365/mt812191 (v=crm.8).
In the sections to follow, you will look at some of the other options available to migrate data to Dynamics 365.
Import Wizard
There is a file size limitation; the maximum file size for .zip files is 32 MB and for other file types such as .csv is 8 MB.
You can link records that have only 1:N relationships where the lookup fields are present on the entity you are importing data for.
Data changes or transformations must be added manually, which leads to errors during the data import.
You can apply only basic mappings. Mappings such as calculations and complex business logic cannot be mapped with this tool.
There are no scheduled imports; it is on demand.
For more complex data imports, you should consider using SQL Server Integration Services. In the next section, you will take a quick look at the options available.
Data Importing with SSIS
Using SQL Server Integration Services is a great way to migrate data from different sources to Dynamics 365. The KingswaySoft ( https://www.kingswaysoft.com/products ) and CozyRoc ( https://www.cozyroc.com/products ) SSIS toolkits enable you to create effective and efficient scripts that move data from the source to the destination. These tools are third-party components, so you must buy a license from the vendor. But, you can easily download the developer version of both these software without any cost and try them. For instance, when you install the developer version of the KingswaySoft SSIS package, you can run the SSIS packages within your development tools such as Visual Studio. The tool is fully functional under the developer license, and the only difference between the licensed version is that you cannot operate it outside the developer tools, for instance scheduled execution. But there is an exception that is worth mentioning. If you want to test scheduled packages, you can acquire a 14-day trail license that will revert to a developer license after 14 days.
In this section, you will look at inserting a list of members and primary contacts into Dynamics 365. First, you must install SQL Server Data Tools for Visual Studio 2017. Visit this link to find out more details: https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-2017 . Next, download and install the SSIS components from the Kingsway Soft product page. Then, create the project to include the data migration scripts. Under New Project, select Business Intelligence and select the Integration Service Project template. Give the project a meaningful name and save it.
When the project is loaded, the SSIS Toolbox will also be loaded, and you can see the components. As the first step of creating the script, you must insert a component such as the Data Flow task on the Control Flow tab. The Data Flow task defines the data from a source to a destination and defines the transformation while moving data. Within the Control Flow tab of the package, you can have multiple data flow tasks and manipulate them using the containers such as the For Loop, Foreach, and Sequence containers. When you double-click or click the Data Flow tab, you can define the actions to perform for that particular data flow task.
Creating the Connection Manager
In this window, you will be selecting the location of the file and leaving the other settings as they are. One important thing to mention here is to check the “Column names in the first data row” option if the first row contains column names. Click OK, and the new connection will appear on the Connection Managers tab.
Configuring the Source
Configuring the Destination
Configuring Error Handling
Now it’s time to configure error handling.
On the Error Handling page, choose the “Redirect rows to error output” option in the “Choose error-handling mechanism” section to direct any duplicate rows to be written to a flat file so that you can examine them, correct the errors, and re-upload them.
Data Transformation
As per the requirements, you have selected both accounts and contacts using two separate Dynamics CRM data sources. Your plan is to merge the outputs together. To do this, you have to sort the data sets separately, and you can use the Sort component from the toolbox. Sorting is a must for merging records. In the Sort Transformation Editor window, you specify the name (member name) as the sorting field. The same setting was applied to the contact list retrieved as well.
Note
Not only for data migration tasks, these SSIS packages are ideal for bulk data updates and scheduled processes. Since the updates are done using the SDK through the destination components, you will have full traceability as well. CozyRoc is similar to KingswaySoft components with minor differences and with pricing differences as well. You have the option to select the tool that best fits your client’s specific scenario.
Summary
In this chapter, you learned about moving data from your legacy system to Dynamics 365. At the beginning of the chapter, a good explanation was given to highlight the importance of setting up a strategy. Next you took a quick peek into the Microsoft FastTrack program, and finally you looked at the out-of-the-box tools and the custom tools that can be used to facilitate the tedious task of data migration.