Tips to conduct a successful upgrade from CRM On Premise to Dynamics 365 Online

This blog post is more relevant if you are looking to upgrade from CRM 2013 or 2015 on premise to Dynamics 365 Online. However, some sections are relevant for all upgrades of Dynamics CRM/365 in general.

With all the features that are added at a very rapid pace to Dynamics 365 and all the features that are exclusive to the cloud version, a lot of companies are looking to upgrade from the current on premises version of CRM to Dynamics 365 online. What are some of the key aspects to consider before and after upgrading?

Before you upgrade

It’s a good idea to look at some of the known issues with your version of Dynamics CRM. For example,

  • The growth of the Async Operation Base table that can cause performance issues (Microsoft provides a resolution here);
  • The growth of the Principal Object Access (POA) table which can also cause performance issues and is mostly due to an excessive use of the record sharing feature (read Scott Sewell’s article about the POA table here)

This is not meant to be an exhaustive list, but the idea is look at what are the known issues or gotcha’s that cause problems in your current version of CRM and fix them prior to starting your upgrade. That way, you will not be upgrading you problems.

The Upgrade Process

While we wait for Microsoft to give us great news allow to import existing Dynamics CRM/365 databases to the cloud for restore, the current migration path to Dynamics 365 in the cloud is to create a solution package that contains cloud-compatible components and import it into a Dyn365 Online organization. That operation is followed by a data migration using the tool(s) of your choice (KingswaySoft, Scribe, CRM Import Wizard, custom solution etc.) to move your data from the on premise version of CRM to the Dynamics 365 in the cloud.

If you are on CRM 2013 SP1 or above, check to Solution Import version compatibility to ensure that your Solution can import into a Dynamics 365 organization. If you are in version prior to CRM 2013, you must upgrade to CRM 2013 SP1.

Now that you know that your solution will be able to import in Dynamics 365, there are changes that need  to be made prior to the move to the cloud and after.

General Considerations

  • You must ensure there is an existing mapping for your CRM users on premise with the cloud subscription your Dyn365 will be running on. You can use Azure AD Connect to make sure you users exists in both active directory.
  • You need to ensure there is connectivity between your existing integration points and your CRM Online instance. Generally, this means that your integration points must be somehow exposed to the internet.

Before you move to Dyn365 Online

  • Download, install and run the Custom Code Validation (from CRM 2015, for 2013). This will allow you to identify the possible bad JavaScript code and update prior to the upgrade.
  • In Dynamics 365 Online, all CRM plugins and custom workflow activities are configured to run in an isolated environment often refer to as sandbox.
    • Running in sandbox means some operations are not allowed. Update your plugins and custom workflow activities following the guidelines if needed:
      • Remove any IO operations read/write disk
      • Remove any operation that access the event logs
      • Remove any operation that access the registry
      • Ensure plugins and custom activities connect to web the right way (see recommendation from Microsoft here)
      • Validate there are no lengthy processes such as asynchronous workflows and/or custom activities. Processes running in a sandbox are configured to timeout after two minutes. If you have any processes of the sort, your options are:
        • Find a way to reduce the execution time of the existing processes
        • Remove the processes from CRM and replace by new functionality
        • Move the business logic to an external process that connects to CRM and perform the business logic on a dedicated machine managed by CFIA.
    • Finally, update the plugins and custom activities to running in fully trusted environment to run in sandbox using the plugin registration tool. If this is not done, you will not be able to import your CRM Solution in Dyn365 Online.
  • In Dynamics 365 Online, access to the CRM database views is not allowed. Reports written in SQL must be replaced
    • Update SQL-based reports to use Fetch XML for querying data
    • When it is not possible to reproduce the same type of complex queries with Fetch XML, you must consider other ways to run your reports (e.g. PowerBI, manual data export to SQL Azure database…)

These steps will remove components that will prevent your solution to be uploaded for Dynamics 365 Online. Once you have gone through the list, you can export your CRM 201x solution package and import it to your Dyn365 Online Organization (import to a dev org as unmanaged).

After you have moved for Dyn365 Online

This is when the fun begins! These are some of the key steps that you have to go through after the solution from a previous version of CRM has been loaded into Dynamics 365 Online.

  • Update plugin and custom workflows libraries SDK references (remove references to SDK version 6.x, 7.x, 8.0, 8.1, and add references to assemblies to SDK version 8.2, fix errors compile errors if any is found)
  • Update client side JavaScript code with new/enhanced Xrm.Page API methods
  • Update client side JavaScript code that calls the OData REST Endpoint to call the Web API instead (use Jason Lattimer’s REST Builder for a HUGE time gain).
  • Update Business Rules to leverage enhanced features where needed (e.g. ability to clear values, default branch, client and server scope etc.)
  • Open each Process Workflow, Dialog, Action (one by one), fix errors if any and activate
  • Open each Business Process Flow (one by one), fix errors if any and activate
  • Open each CRM form from used entities, verify the look and feel, adjust as needed
  • Open each dashboard (if any), validate look and feel and adjust as needed
  • Validate Sitemap and Application ribbons
  • Update your Email Router configuration (or Migrate settings from the Email Router to Server Side Synchronization)
  • Review and update functionalities as needed (e.g. replace plugins with Synchronous workflows or Business Rules, leverage other new features where possible and required) – this is a classic one liner that can take days, weeks or months to be completed depending on how complex your system is J
  • Export the solution as managed and import in your pre-prod (or other environment based on your internal release model) for testing
  • Gear up for your data migration using the tool(s) of your choice, test it, test it, test it again, then run it J
  • Go to production J

There you have it. It is always good to have a checklist of things to look for when upgrading a Dynamics CRM to the cloud (also applicable for partner hosted scenarios).

Leverage the power of Power BI with Dynamics CRM data

Yesterday I attended a presentation from felow MVP Sophie Marchand about Power BI. I had previous exposure to Power BI when it became generally available for free as part of the Office 365 suite. The content of the presentation was around multiple areas in Power BI, so I thought I’d revisit some of them and put some thought into how we could leverage the power of the Business Intelligence platform to manipulate and play with Dynamics CRM data.

Connecting Dynamics CRM Online to Power BI (web)

This area is well documented. When you create or log on to you Power BI account, you can get Dynamics CRM Online data by going to the “Get Data” section, selecting “Services” and finding the Microsoft Dynamics CRM content pack.


Once you click on Connect, you will need to provide your Dynamics CRM Online OData Service URL (make sure you don’t leave a trailing slash in the end).


Once this process is completed, Power BI will connect to your Dynamics CRM Online Organization, get a set of data and build a Sales Manager Dashboard. That dashboard is pre-configured as part of the native integration between CRM Online and Power BI. Keep in mind that you can also connect to CRM Online from Power BI for Desktop. The way the data is structured is a bit different and you don’t get the Sales Manager Dashboard by default. That being said, it bring the data in using the OData Service and gives you the ability to create your own visualizations and reports. Let’s take it a step further and see what options you have if you need to manipulate data from custom entities and create visuals, dashboards that are useful for your business.

Custom Dynamics CRM data sources for Power BI

If you want to leverage Power BI, which you should in many ways, there are other ways to connect it to your CRM data. Here are some of the options that you have.

Extract Dynamics CRM in Excel Spreadsheets and Import the files to Power BI

Power BI (web)


Power BI for Desktop


For CRM On-Premise organizations, using Power BI for Desktop, you can simply connect to your CRM Database start creating for dimensions, cubes and reports from there. If you need more information on how to get started with Power BI for Desktop, make sure you check out Microsoft’s article here.


Worth noting, you can export your Power BI for Desktop content and upload it to the Power BI web platform. This gives you the ability to view the dashboards online, question it differently and also share it with people in your organization. In the Dynamics CRM and Microsoft ecosystem, it has never been easier to build reports and intelligence around your operational data. Enjoy!

CRM Online 2015 Update 1 – Alternate Keys

Very often in CRM implementations, we find ourselves writing plugins to validate the unicity of records and prevent the creation of duplicates. One example is having contacts uniquely identified by an email address. That can be useful for user login from portals (unique emails in CRM), or when integrated systems need to connect to CRM and perform operations on existing records (no need to synchronize the CRM ID, use an existing alternate identifier to access your data).

The Dynamics CRM Online 2015 Update 1 brings a new and exciting functionality to handle this type of scenario very easily: Alternate Keys.

Alternate keys enable data integration in an efficient manner. Users can now define an attribute in a Microsoft Dynamics CRM entity to correspond to a unique identifier (or combination of columns) used by an external data store. Use this alternate key to uniquely identify a record in CRM in place of the primary key. This feature enhances the developer and customer experience by:

  • Reducing roundtrips to look up record IDs from other unique columns.
  • Increasing overall throughput of bulk data processes, especially with CRM Online.
  • Simplifying programming from external systems without CRM record IDs.

How to Define an Alternate key?

  1. Navigate to the Customization area and expand the target entity
  2. Select “Keys”
  3. Click New to define a new key

  1. Define a name for your key
  2. Select the attribute(s) that define your key from the “Available Attributes” and add them to the “Selected Attributes” columns
  3. Click OK

Once this is completed, CRM will create an asynchronous system job that will create the database index to enforce uniqueness and optimize lookup performance. The process can be lengthy if there are lots of existing records in the table for which the new key is created. The possible statuses the after creating an alternate key are the following:

  • Pending (waiting for the asynchronous job to start)
  • In Progress (system job – and SQL job – running)
  • Active
  • Failed

It’s worth noting that if there is existing data that violates the uniqueness defined by the new key, the job will fail and the key will not be activated. Looking at the asynchronous job will give you details of the failure as shown in the screenshot below.

This is great because it forces an initial cleanup of your system data before you can use existing fields as alternate keys.

Now that you’ve created an alternate key, you can run a quick test to validate that the new unique key is being enforced by the system. To that, simply create two records with the same key (in my case, 2 contacts with the same email address). You will get “Duplicate Record” error message as shown below.

So how about code? What can I do from a coding perspective?

The process of creating, retrieving and deleting Alternate Keys can be done using the API. Read more about the new SDK requests that allow to manage the alternate keys on MSDN.

It only makes sense that we can now create instances of Entities and EntityReference classes using alternate keys. You can read more on this on MSDN. Here are the new constructors for the Entity and EntityReference tables:

public Entity (string logicalName, Guid id) {…}
public Entity (string logicalName, string keyName, object keyValue) {…}
public Entity (string logicalName, KeyAttributeCollection keyAttributes) {…}
public EntityReference(string logicalName, Guid id) {…}
public EntityReference(string logicalName, string keyName, object keyValue) {…}
public EntityReference(string logicalName, KeyAttributeCollection keyAttributeCollection) {…}

This is a very exciting feature. Hopefully, it will soon make it to the On-Premise version of Dynamics CRM so we can all benefit from it!


Synchronize CRM Online Data with Skyvia

I just discovered an interesting tool, thought I’d share a quick review.

Skyvia is a cloud data integration solution. It has connectors to a few data sources and is able to move data from one cloud based source to another based on configuration and schedule. Oh I forgot to mention, it’s FREE J

As a test, I configured it to connect to my Dynamics CRM Online sandbox organization and my Zoho CRM organization:

Once my connections are created and validated, I create and design a package to transfer contacts from Dynamics CRM Online to Zoho CRM:

As you can see on the screenshot above, Skyvia gives you the ability to create synchronization tasks (1) and also to schedule the execution your packages (2). The package can also be ran manually.

The tool can be very handy especially if you have simple synchronization needs between CRM and other systems. The supported data sources are Dynamics CRM Online, MySQL, PostgreSQL, SQL Server,, Zoho CRM, Sugar CRM. Obviously such a tool does not replace the need for more complete and mature data integration products such as Scribe and SSIS connectors, but it provides an easy way to achieve simple data integration between multiple cloud based systems. Works perfectly for me demos! And it’s free (at least for now).

CRM Online & SharePoint Online Integration

I was given an interesting task: integrate CRM Online with SharePoint Online (the native integration). Usually, it’s straight forward…

You have a few steps from a CRM/SharePoint perspective:

  • Download and install the CRM 2011 List Component for SharePoint (available for SP 2010 and 2013)
  • Configure SharePoint Sites in CRM (add your SharePoint site)
  • Configure CRM entities and add “Document Locations”

In fact, it’s so easy to setup that I think it’s crazy to have a document management system other than SharePoint if you want to integrate with Dynamics CRM… but that’s beside my point J.

Back on track, there are plenty of CRM/SharePoint environment setup scenarios (e.g. CRM Online & SharePoint On-Premise; CRM On-Premise & SP Online etc.). I am focusing on CRM Online and SharePoint Online.

In order for the integration to work smoothly, your SharePoint and CRM Online subscriptions should be part of the same Office 365 subscription. The reason for that is that authentication will be done through the same token(s). This makes sense, you log in once and have access to all Office 365 applications. In our case, the problem is Office 365 only recently added CRM Online and in our case, our instance hasn’t been migrated to our Office 365 subscription yet. How do we do integration then?

When some of the system users log on to CRM Online and try to view documents, this is what they get:

In order to make it work, all they need to do is connect to their Office 365 account in the same browser. Then they can simply refresh the Account form and navigate to the documents grid again. The Office 365 authentication token in the browser session will be used when the SharePoint document list in being displayed in the CRM frame.

Of course, in order to setup the integration, you need to be connected to Office 365 as well. The error above is something that end users will see and conclude that something is not working. It is important to find a way to let them know all they need to do is connect to Office 365. As for you CRM Admins, keep the faith and wait until your CRM Organizations get migrated to Office 365…