-
Notifications
You must be signed in to change notification settings - Fork 10
Examples
The is a simple example of the configuration files for active Contacts.
- Schema File
<entities >
<entity name="contact" displayname="Contact" etc="2" primaryidfield="contactid" primarynamefield="fullname" disableplugins="false">
<fields>
<field displayname="First Name" name="firstname" type="string" />
<field displayname="Last Name" name="lastname" type="string" />
<field displayname="Parent Contact" name="parentcontactid" type="entityreference" lookupType="contact" />
<field displayname="Contact" name="contactid" type="guid" primaryKey="true" />
<field displayname="Home Phone" name="telephone2" type="string" />
<field displayname="Mobile Phone" name="mobilephone" type="string" />
</fields>
<relationships />
</entity>
</entities>
- Export Config
{
"CrmMigrationToolSchemaPaths": [
"ConfigDataSchema.xml"
],
"CrmMigrationToolSchemaFilters": {
},
"PageSize": 1000,
"BatchSize": 1000,
"TopCount": 10000,
"OnlyActiveRecords": false,
"JsonFolderPath": "Extract",
"OneEntityPerBatch": true,
"FilePrefix": "EX0.1",
"SeperateFilesPerEntity": true,
"LookupMapping": {}
}
- Import Config
{
"IgnoreStatuses": false,
"IgnoreSystemFields": true,
"MigrationConfig": {
"ApplyAliasMapping": true,
"SourceRootBUName": "Example1BU",
"Mappings": {}
},
"SaveBatchSize": 200,
"JsonFolderPath": "Extract",
"DeactivateAllProcesses": false,
"FilePrefix": "EX0.1",
"PassOneReferences": [
]
}
The is a example of the configuration files for Team and Queues.
- Schema File
<entities xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<entity name="queue" displayname="Queue" etc="2020" primaryidfield="queueid" primarynamefield="name" disableplugins="false">
<fields>
<field displayname="Incoming Email" name="emailaddress" type="string" primaryKey="false" customfield="false" />
<field displayname="Type" name="queueviewtype" type="optionsetvalue" primaryKey="false" customfield="false" />
<field displayname="Description" name="description" type="memo" primaryKey="false" customfield="false" />
<field displayname="Queue" name="queueid" type="guid" primaryKey="true" customfield="false" />
<field displayname="Convert To Email Activities" name="ignoreunsolicitedemail" type="bool" primaryKey="false" customfield="false" />
<field displayname="Incoming Email Delivery Method" name="incomingemaildeliverymethod" type="optionsetvalue" primaryKey="false" customfield="false" />
<field displayname="Convert Incoming Email To Activities" name="incomingemailfilteringmethod" type="optionsetvalue" primaryKey="false" customfield="false" />
<field displayname="Name" name="name" type="string" primaryKey="false" customfield="false" />
<field displayname="Business Unit" name="businessunitid" type="entityreference" primaryKey="false" lookupType="businessunit" customfield="false" />
</fields>
<relationships />
</entity>
<entity name="team" displayname="Team" etc="9" primaryidfield="teamid" primarynamefield="name" disableplugins="false">
<fields>
<field displayname="Description" name="description" type="memo" primaryKey="false" customfield="false" />
<field displayname="Team" name="teamid" type="guid" primaryKey="true" customfield="false" />
<field displayname="Team Name" name="name" type="string" primaryKey="false" customfield="false" />
<field displayname="Business Unit" name="businessunitid" type="entityreference" primaryKey="false" lookupType="businessunit" customfield="false" />
<field displayname="Email" name="emailaddress" type="string" primaryKey="false" customfield="false" />
<field displayname="Team Type" name="teamtype" type="optionsetvalue" primaryKey="false" customfield="false" />
<field displayname="Default Queue" name="queueid" type="entityreference" primaryKey="false" lookupType="queue" customfield="false" />
</fields>
<relationships>
<relationship name="teamroles" manyToMany="true" isreflexive="false" relatedEntityName="teamroles" m2mTargetEntity="role" m2mTargetEntityPrimaryKey="roleid" />
</relationships>
</entity>
</entities>
- Export Config
{
"CrmMigrationToolSchemaPaths": [
"ConfigDataSchema.xml"
],
"CrmMigrationToolSchemaFilters": {
},
"PageSize": 1000,
"BatchSize": 1000,
"TopCount": 10000,
"OnlyActiveRecords": false,
"JsonFolderPath": "Extract",
"OneEntityPerBatch": true,
"FilePrefix": "EX0.1",
"SeperateFilesPerEntity": true,
"LookupMapping": {}
}
- Import Config
{
"IgnoreStatuses": false,
"IgnoreSystemFields": true,
"MigrationConfig": {
"ApplyAliasMapping": true,
"SourceRootBUName": "Example1BU",
"Mappings": {}
},
"SaveBatchSize": 200,
"JsonFolderPath": "Extract",
"DeactivateAllProcesses": false,
"FilePrefix": "EX0.1",
"PassOneReferences": [
]
}
This example of the configuration files are for Teams and Team Roles.
- Schema File
<entities xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<entity name="team" displayname="Team" etc="9" primaryidfield="teamid" primarynamefield="name" disableplugins="false">
<fields>
<field displayname="Team" name="teamid" type="guid" primaryKey="true" customfield="false" />
<field displayname="Team Name" name="name" type="string" primaryKey="false" customfield="false" />
<field displayname="Business Unit" name="businessunitid" type="entityreference" primaryKey="false" lookupType="businessunit" customfield="false" />
</fields>
<relationships>
<relationship name="teamroles" manyToMany="true" isreflexive="false" relatedEntityName="teamroles" m2mTargetEntity="role" m2mTargetEntityPrimaryKey="roleid" />
</relationships>
</entity>
</entities>
- Export Config
{
"CrmMigrationToolSchemaPaths": [
"ConfigDataSchema.xml"
],
"CrmMigrationToolSchemaFilters": {
},
"PageSize": 1000,
"BatchSize": 1000,
"TopCount": 10000,
"OnlyActiveRecords": false,
"JsonFolderPath": "Extract",
"OneEntityPerBatch": true,
"FilePrefix": "EX0.1",
"SeperateFilesPerEntity": true,
"LookupMapping": {}
}
- Import Config
{
"IgnoreStatuses": false,
"IgnoreSystemFields": true,
"MigrationConfig": {
"ApplyAliasMapping": true,
"SourceRootBUName": "Example1BU",
"Mappings": {}
},
"SaveBatchSize": 200,
"JsonFolderPath": "Extract",
"DeactivateAllProcesses": false,
"FilePrefix": "EX0.1",
"PassOneReferences": [
]
}
This example of the configuration files for allocating Business Units, Security Roles, Timezones and Formats for Users.
- Schema File
<entities xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<entity name="systemuser" displayname="User" etc="8" primaryidfield="systemuserid" primarynamefield="fullname" disableplugins="false">
<fields>
<field displayname="User Name" name="domainname" type="string" primaryKey="false" customfield="false" />
<field displayname="Last Name" name="lastname" type="string" primaryKey="false" customfield="false" />
<field displayname="First Name" name="firstname" type="string" primaryKey="false" customfield="false" />
<field displayname="User" name="systemuserid" type="guid" primaryKey="true" customfield="false" />
<field displayname="Access Mode" name="accessmode" type="optionsetvalue" primaryKey="false" customfield="false" />
<field displayname="Business Unit" name="businessunitid" type="entityreference" primaryKey="false" lookupType="businessunit" customfield="false" />
</fields>
<relationships>
<relationship name="systemuserprofiles" manyToMany="true" isreflexive="false" relatedEntityName="systemuserprofiles" m2mTargetEntity="fieldsecurityprofile" m2mTargetEntityPrimaryKey="fieldsecurityprofileid" />
<relationship name="systemuserroles" manyToMany="true" isreflexive="false" relatedEntityName="systemuserroles" m2mTargetEntity="role" m2mTargetEntityPrimaryKey="roleid" />
<relationship name="teammembership" manyToMany="true" isreflexive="false" relatedEntityName="teammembership" m2mTargetEntity="team" m2mTargetEntityPrimaryKey="teamid" />
</relationships>
</entity>
<entity name="usersettings" displayname="User Settings" etc="150" primaryidfield="systemuserid" disableplugins="false">
<fields>
<field displayname="" name="dateseparator" type="string" primaryKey="false" customfield="false" />
<field displayname="" name="systemuserid" type="guid" primaryKey="true" customfield="false" />
<field displayname="" name="userprofile" type="string" primaryKey="false" customfield="false" />
<field displayname="" name="dateformatstring" type="string" primaryKey="false" customfield="false" />
<field displayname="" name="timeseparator" type="string" primaryKey="false" customfield="false" />
<field displayname="" name="currencysymbol" type="string" primaryKey="false" customfield="false" />
<field displayname="" name="decimalsymbol" type="string" primaryKey="false" customfield="false" />
<field displayname="" name="timeformatstring" type="string" primaryKey="false" customfield="false" />
</fields>
<relationships />
</entity>
</entities>
- Export Config
{
"CrmMigrationToolSchemaPaths": [
"ConfigDataSchema.xml"
],
"CrmMigrationToolSchemaFilters": {
},
"PageSize": 1000,
"BatchSize": 1000,
"TopCount": 10000,
"OnlyActiveRecords": false,
"JsonFolderPath": "Extract",
"OneEntityPerBatch": true,
"FilePrefix": "EX0.1",
"SeperateFilesPerEntity": true,
"LookupMapping": {}
}
- Import Config
{
"IgnoreStatuses": false,
"IgnoreSystemFields": true,
"MigrationConfig": {
"ApplyAliasMapping": true,
"SourceRootBUName": "Example1BU",
"Mappings": {}
},
"SaveBatchSize": 200,
"JsonFolderPath": "Extract",
"DeactivateAllProcesses": false,
"FilePrefix": "EX0.1",
"PassOneReferences": [
]
}
Customer service schedule and holiday schedule are stored in Calendar entity. There are four types of calendar in Microsoft Dynamics 365.
Calendar | Type | Description |
---|---|---|
Customer Service Schedule | 1 | |
Holiday Schedule | 2 | |
Inner Calendar | -1 | Inner calendars are used by other calendars |
Default Calendar | 0 |
Customer service calendar contain weekly schedules which are stored as inner calendars. So in order to migrate customer service schedule, we have to identify customer service calendar and their inner calendars. Calendar Rule is the entity which holds information about calendar and associated inner calendars. But we cannot directly read Calendar Rule entity. Below FetchXML query can be used to identify customer service calendar and related inner calendars.
<fetch top="50" >
<entity name="calendar" >
<attribute name="name" />
<filter type="or" >
<condition attribute="type" operator="eq" value="1" />
</filter>
<link-entity name="calendarrule" from="calendarid" to="calendarid" alias="CalRule" >
<attribute name="innercalendarid" />
<attribute name="calendarid" />
</link-entity>
</entity>
</fetch>
Once we identified calendar and their inner calendar GUIDs. We can apply filtering in export configuration file of the Data Migration Tool.
<filter type="or" >
<condition attribute="type" operator="eq" value="1" />
<condition attribute="calendarid" operator="eq" value="<<Inner Calendar ID 1>>" />
<condition attribute="calendarid" operator="eq" value="<<Inner Calendar ID 2>>" />
</filter>
If you also would like to migrate Holiday schedule then we can simply extend above filter to include an additional condition.
<filter type="or" >
<condition attribute="type" operator="eq" value="1" />
<condition attribute="type" operator="eq" value="2" />
<condition attribute="calendarid" operator="eq" value="<<Inner Calendar ID 1>>" />
<condition attribute="calendarid" operator="eq" value="<<Inner Calendar ID 2>>" />
</filter>
Schema used:
<entity name="calendar" displayname="Callendar" etc="4201" primaryidfield="calendarid" primarynamefield="CalendarId" disableplugins="false">
<fields>
<field displayname="CalendarId" name="calendarid" type="guid" primaryKey="true" />
<field displayname="HolidayScheduleCalendarid" name="holidayschedulecalendarid" type="entityreference" lookupType="calendar" />
<field displayname="BusinessUnitId" name="businessunitid" type="entityreference" lookupType="businessunit" />
<field displayname="Callendar Type" name="type" type="optionsetvalue" />
<field displayname="Description" name="description" type="string" />
<field displayname="Name" name="name" type="string" />
<field displayname="ISShared" name="isshared" type="boolean" />
</fields>
</entity>