Related sites:

Newsletter: Perspectives on Power Platform

Company: Niiranen Advisory Oy

Configuration Migration Tool: Working Smarter with Metadata Entities

34 Comments

  1. Hi Jukka,

    Heard about this but haven’t had the opportunity to use it yet.

    Did you happen to notice how it handled Created On, Created By, Modified On and Modified By? I’m assuming it can’t do any better than other import tools (it would be nice if we could preserve all four…) but I wondered if it preserved the Created On? (The CRM instance adaptor seems to do this by default).

    Also I wonder if it can preserve GUIDs in configuration data that you can’t delete/re-create (for example the Team associated with the default Business Unit or CRM Online Users) – the instance adaptor doesn’t seem to be able to handle these.

    For CRM Online I’m currently trying to use the new sandbox minimal copy features to do this. They still don’t seem to be working properly so wondering if this might be an acceptable alternative…

    • Simon, the Created On and Modified On dates were not preserved by Configuration Migration Tool. I’d imagine this also falls within the “non goals” of this tool, as it isn’t designed for business data migration. The Instance Adapter probably overrides the Created On date via the supported API methods and stores the physical creation date to Record Created On field?

      I ran a test between 2 on-premises organizations with a schema file consisting of business units, teams and users. The results were quite interesting, as the CMT import progress showed all green (apart from one yellow alerts for the INTEGRATION and SYSTEM users that were skipped), but no new records whatsoever were created in the target organization at any point. The records were simply queued for second pass update, but eventually none of them found their way into CRM.

  2. Jukka, I have tried to connect (Import) to CRM Online trial today and it will not connect with no error. I have tried both O365 and Online options but the same result. Have you managed a successful connection Online?

  3. Thanks Jukka. PS. I think your blogs are top notch, keep up the great work 🙂

  4. This tool is terrific. Thanks for tackling the deep dive! Extremely helpful. Readers may note that the speed of export and import is significantly slower given that the GUIDs are preserved and so the SQL performance is not as high as when allowing the system to create the GUIDs.

    Great Work!

    Joe

  5. I had assumed (wrongly I think) that the new sandbox copy features in CRM Online were somehow based on this tool behind the scenes. That doesn’t seem to be the case – using the sandbox copy features we appear to be able to preserve Created On, Created By, Modified On and Modified By as well as (most of) the GUIDs.

    There are a few anomalies however:

    Minimal Copy:
    • GUID and Name of Default Business Unit is not preserved
    • Version Number attribute is not preserved on entities I’ve looked at (I’m not sure if this is correct or not)
    • Default Duplicate Detection rules are not copied correctly (owner etc.)
    • Default System Jobs are not copied or created at all
    • Not clear which entities are copied and which are not.

    Full Copy:
    • GUID and Name of Default Business Unit is not preserved
    • Version Number attribute is not preserved on entities I’ve looked at (I’m not sure if this is correct or not)
    • Default Duplicate Detection rules are not copied correctly (owner etc.)
    • Some (but not all?) workflows that were “waiting” now appear “cancelled” in the System Jobs grid but “waiting” if you open them (possibly something to do with still being in Admin mode for the moment?)

    I’ve not had time to investigate further – hoping some of them will be fixed/better documented in due course.

    • Thanks for reporting your findings, Simon. I haven’t yet had a chance to try the CRM Online sandbox copy process, but as you mentioned, it is indeed a separate mechanism from the Configuration Migration Tool. The latter works for all deployment models, but sandbox management is specific to Microsoft hosted cloud organizations. Whereas in an on-premises environment you could copy your production CRM database to create a development sandbox, in CRM Online you would have to use the new sandbox management tools provided in the Spring ’14 release.

      For those who are interested in the CRM Online sandbox related features, here’s a few articles from MSDN: Manage CRM Online sandbox instances and Copy an instance. For a quick overview of what the sandboxes mean in practice, you can watch this video on YouTube or read this blog post from Inogic.

      One thing you need to be aware of is that all the sandbox environments count towards your CRM Online subscription’s storage quota. Never perform a Full Copy of your production instance if you’re close to 40% utilization rate of your current storage. This is because a Full Copy would push you beyond the 80% threshold, after which certain functionality in CRM Online may not be available to you. For more information on the implications of reaching the storage limit, read this article from the CRM Team blog.

  6. When I try to migrate Email Attachments

    DataMigrationUtility.Import Information 8 ** BEGIN IMPORT PROCESS **
    DataMigrationUtility.Import Information 8 ** Log Start: 12/04/2014 00:59:00
    DataMigrationUtility.Import Information 8 Parsing import data file
    DataMigrationUtility.Import Information 8 Parse Complete
    DataMigrationUtility.Import Information 8 Beginning Import To CRM.. Importing 1 entities – 1 records
    DataMigrationUtility.Import Information 8 Running Schema Validation
    DataMigrationUtility.Import Information 8 Validating 1 Entities
    DataMigrationUtility.Import Information 8 Schema Validation Completed
    DataMigrationUtility.Import Information 8 Schema Validation Complete
    DataMigrationUtility.Import Information 8 Processing Entity Data
    DataMigrationUtility.Import Information 8 Processing Entity: Email Attachment
    DataMigrationUtility.Import Information 8 Processing Entity Email Attachment, 1 Records in this entity
    DataMigrationUtility.Import Information 8 Processing Entity Email Attachment, 1 Records in this entity
    DataMigrationUtility.Import Information 8 Beginning Import of entity
    DataMigrationUtility.Import Information 8 Pre-Processing Entity Email Attachment
    DataMigrationUtility.Import Warning 4 Adding activitymimeattachment to the reprocess List as field attachmentid () – (action:Update) failed validation for reason code: LookupRecordNotAvailable
    DataMigrationUtility.Import Warning 4 Adding activitymimeattachment to the reprocess List as field attachmentid () – (action:Update) failed validation for reason code: LookupRecordNotAvailable
    DataMigrationUtility.Import Warning 4 Adding activitymimeattachment to the reprocess List as field objectid () – (action:Update) failed validation for reason code: LookupRecordNotAvailable
    DataMigrationUtility.Import Warning 4 Adding activitymimeattachment to the reprocess List as field objectid () – (action:Update) failed validation for reason code: LookupRecordNotAvailable
    DataMigrationUtility.Import Warning 4 Adding activitymimeattachment to the reprocess List as field owninguser () – (action:Skip) failed validation for reason code: LookupRecordNotAvailable
    DataMigrationUtility.Import Warning 4 Adding activitymimeattachment to the reprocess List as field owningbusinessunit () – (action:Skip) failed validation for reason code: LookupRecordNotAvailable
    DataMigrationUtility.Import Warning 4 Adding activitymimeattachment to the reprocess List as field activityid () – (action:Update) failed validation for reason code: LookupRecordNotAvailable
    DataMigrationUtility.Import Warning 4 Adding activitymimeattachment to the reprocess List as field activityid () – (action:Update) failed validation for reason code: LookupRecordNotAvailable
    DataMigrationUtility.Import Verbose 16 GetFieldsForThisRow duration = 00:00:00.0009866
    DataMigrationUtility.Import Verbose 16 Restricted Record Type Check= False
    DataMigrationUtility.Import Information 8 Processing Email Attachment (threaded), Imported 0 of 1
    DataMigrationUtility.Import Information 8 Connection 1 has imported 0 of 0 : 0 – THREAD COMPLETE
    DataMigrationUtility.Import Information 8 Connection 1 has imported 0 of 0 : 0 – THREAD COMPLETE
    DataMigrationUtility.Import Information 8 Connection 1 has imported 0 of 0 : 0 – THREAD COMPLETE
    DataMigrationUtility.Import Information 8 Connection 1 has imported 0 of 0 : 0 – THREAD COMPLETE
    DataMigrationUtility.Import Verbose 16 Result of Check and Retrieve Record Id = 00000000-0000-0000-0000-000000000000
    DataMigrationUtility.Import Error 2 Insert to activitymimeattachment FAILED with Error : Email
    DataMigrationUtility.Import Information 8 Connection 1 has imported 1 of 1 : 1 – THREAD COMPLETE
    DataMigrationUtility.Import Information 8 Processing Email Attachment (threaded), Imported 1 of 1
    DataMigrationUtility.Import Information 8 Entity Email Attachment, Completed Importing 0 of 1
    DataMigrationUtility.Import Information 8 Stage Complete
    DataMigrationUtility.Import Information 8 Import Process completed
    DataMigrationUtility.Import Information 8 Import Process completed – Import duration: 00:00:05.9836505 – RPS:.17
    DataMigrationUtility.Import Information 8 *********************************************************
    DataMigrationUtility.Import Information 8 ** EXIT IMPORT PROCESS COMPLETE **
    DataMigrationUtility.Import Information 8 *********************************************************
    DataMigrationUtility Information 8 The import to CRM is complete. Duration of import: 00:00:05.9854031

  7. Hello Jukka,

    So, what you mean about CMT and matching is that we should configure the mapping before the schema creation? Because of that, the matching will be done using the primary field instead of GUID? That’s right?

    Thanks for clarifying that.

    Regards,

  8. I would imagine a not uncommon use-case would be transferring product catalogs between instances but the the dependency of product on target uom and uomschedule seems to preclude this unless there is any trick available? Thanks.

  9. Another great blog Jukka. If anyone is wondering I just confirmed through testing that the tool also works for CRM 2011! 🙂

    However I was attempting to migrate the setup data for CRM Goals (Goal Metrics, Rollup Fields & Rollup Queries) and ran into an issue. It seems that the CMT doesn’t allow you to select Rollup Fields as part of the schema to export. Any Ideas on how to hack it to do so?

    Thanks!

  10. Hi ,

    I have a requirement to sync two organizations . Will this tool be useful in that case?

    I tried exporting and importing couple of entities and i never get the complete record imported . Keep getting warning on second pass updates and it never happens. Can you please help me out here . Thanks 🙂

  11. Hi, it seems that hirachies can not be exported and imported this way. We want to copy our whole bunch of product families, bundles and products from our test environment to the live environment, but the import only adds the items that are on top in the hiarchies. i.e. bundles which are childs of product families are not imported. How to fix that?

  12. For Teams you need to replace the Business Unit information in the xml with the target information of the root/respective business unit. Also remove the tag about Queue in the xml. After importing the queue is created automatically. Or separately the queues can be migrated as well

  13. Hi Jukka Niiranen,

    what if, on the target instance we don’t have some entities but the source instance from where we have generated zip file using CMT have those entities, will the process stuck in between or will CMT allow to import the entities data which are available for target instance by leaving those entities which are not available on target instance.

    Thanks

    • Popeye, I haven’t tested such a scenario. Since you are able to select the entities you want to export, I’d find it a bit strange to attempt a migration of data that cannot possibly be imported into the target instance. Even if part of the data would get properly migrated, it still sounds like an unnecessary risk to take. At least I would rather not have any error messages shown at the end of an import process, as it’s usually quite important to have the certainty that the data you attempted to migrate was pushed to the target instance fully without any unwanted alterations.

  14. Great article. Do you know if there’s a command line option? We’re working with USD and need to suck out the config data for source control and builds, in a format that the PackageDeployer will understand.

    • John, I haven’t come across such an option in CMT myself. Have you looked into Adxstudio ALM Toolkit to see if it would meet this requirement? It’s been made available for free after Microsoft acquired Adxstudio so it could almost be considered as part of the CRM SDK now.

      • Haven’t looked at the Adx Toolkit before. Don’t think it will satisfy this though as we need the data to come out in a format that will be understood by the Package Deployer. We’ve got around it at the moment by having some Powershell that, amongst other things, pops the Configuration Migration Tool in front of the developer on a Clean of the USD Visual Studio project. It works for us at the moment but if we could command line it then there’s less clicks for the developers to go through (or forget to do!).

        Will certainly look deeper into the Adx Toolkit though, There’s some stuff there that would be useful for other things that we’re either doing already or need to do.

  15. The Adxstudio ALM Toolkit is not supported anymore after the Microsoft acquisition, it’s abandonware. Do not make any new or further invests in it.

  16. Is there a best practice guide for selecting entities to export? The lazy option would be to select all the entities and export all of them, but this is obviously not ideal. How can I determine which entities contain metadata that either I or a team member have modified? Forgive my question if it’s naive–I’m an administrator-by-accident of a new (and tiny) CRM instance.

    • Jim, I don’t think there’s a way to select “only entities with customizations” in the standard UI. To identify where customizations have been made, it might be good to start with an export like Metadata Document Generator in XrmToolBox to get a list of each entity’s components and then view the resulting Excel file for rows with customized fields. If you need to go even deeper in the metadata analysis, give Snapshot a try.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.