Migrating Data

Most of your implementations will contain a data migration component as part of your production deployment. Further, you need to import data when developing, testing, or providing a demo of the application. Given the importance of this task, you should understand your options for data migration within Microsoft Dynamics CRM.

The following approaches are common when importing data with Microsoft Dynamics CRM. They are listed starting from the easiest to accomplish to the most challenging:

  • Native Microsoft Dynamics CRM import

  • Data Migration Manager

  • Third-party tools

  • Custom code

Native Microsoft Dynamics CRM Import

Microsoft Dynamics CRM 4.0 allows for simple list imports to almost all entities, including custom entities. You access the native import functionality from the Tools menu and then proceed through a series of simple wizard screens to import your data. This approach works especially well when you have a 1-1 source-to-destination table mapping. Keep the following in mind when using the native Microsoft Dynamics CRM import tool:

  • Be sure you have all required fields in your source data file.

  • Save your source data file in the CSV format, and then run through the native import process.

  • All records imported through the native Import functionality will be owned by you. If you need the records to be owned by someone else, you should either use an alternative method of import or simply reassign the records after you get them into the system (manually or with a workflow rule).

  • To have relationships map, you need to have CRM automatically map the data for your import. To do this, ensure your import columns match EXACTLY the attribute display name. Further, you should also consider the following:

    • Be sure related records or picklist values exist in the system prior to import.

    • You can use the display value or the actual value of the lookup or picklist record. For lookup relationships, the display name will be the primary attribute and the record GUID will be its value. For picklist attributes, the display name will be the name shown to users and its value will be an integer.

    • If your name (for either the lookup or the picklist) has duplicates, the record will not be imported. You will receive an error similar to "A duplicate lookup reference was found." You can avoid this by specifying the GUID (record ID of the referenced value) or integer (identifier for the picklist value) instead of the name. Keep in mind that only the record with the duplicate name will fail, not the entire import.

Data Migration Manager

Microsoft provides a more extensive data migration management tool called Microsoft Dynamics CRM 4.0 Data Migration Manager (DMM). The DMM includes sample data conversion maps from some common CRM systems. Further, the DMM overcomes the native import ownership limitation by allowing you to specify different owners for the records.

Caution

Caution

A separate DMM exists for CRM Online. Be sure you use the correct version.

Download DMM for on-premise deployments at http://www.microsoft.com/downloadS/details.aspx?FamilyID=6766880a-da8f-4336-a278-9a5367eb79ca&displaylang=en and use http://www.microsoft.com/downloads/details.aspx?FamilyId=2BBB3832-4B5F-4C2D-BFA8-2E74666F51DB&displaylang=en for the CRM Online version.

Third-Party Tools

You can also find some useful third-party tools for data migration. A company called Scribe produces one of the more popular migration tools. The advantage of using a third-party tool would be to leverage existing templates and support from the import tool manufacturer. The downside is that these tools cost money and there is a learning curve to get your team up to speed on them.

Custom Code

When all else fails, you can always resort to writing your own import procedures, using the Microsoft Dynamics CRM API or directly with SQL. As you will learn throughout this book, you should have no trouble working with the Microsoft Dynamics CRM to load data into the application.

Caution

Caution

Microsoft does not support inserting data directly to the SQL Server database.

When using the Microsoft Dynamics CRM API to insert data in bulk, you should pay attention to performance of the Web service. Because you will typically load data with a program running as a specific user, you can take advantage of connection sharing as shown below:

// Create the service
CrmService service = new CrmService();
service.Credentials = _crmService.Credentials;
service.Url = _crmService.Url;

// Enable unsafe connection sharing
service.UnsafeAuthenticatedConnectionSharing = true;

Enabling the UnsafeAuthenticatedConnectionSharing option will significantly increase performance of your migration.

Please review Chapter 3, for more information regarding the CrmService Web service.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset