Migration of Personal views/charts/dashboards with sharing information

In my previous blog I explained the issues that I faced while POA entity migration. Here I will explain the whole process that I followed to migrate the personal views with sharing information. I used kingsway soft adapter for my migration process.

We have 2 steps to migrate the data

  1. Source CRM –> Intermediate database.
    1. I enabled “Data Export Services” on the source instance to push the data into intermediate database.
    2. Since “userquery” entity is not available in “Data Export Services”, I Designed a simple SSIS Package with source (Dynamics CRM) and destination (OLE DB) components.
    3. We have to impersonate the owner of the personal view in the Dynamics CRM Source component to read this information.
    4. So we have to run this package multiple times based on the user count.
  1. Intermediate database –> Target CRM
    1. Designed 2 more SSIS Packages to push “userquery” and “principalobjectaccess” (share) information to Target CRM instance.
    2. userquery package is pretty straightforward with source (OLE DB) and destination (Dynamics CRM) components. So I am not explaining much about this package.
    3. But we faced some issues which I explained in the previous blog while migrating “principalobjectaccess” data. I followed the below process to migrate this data.
      • Created a SQL View in intermediate database on “principaobjectaccess” table by joining the “userquery” table to get the owner of the personal view.
      • I used this view in “OLE DB” source component to read the data.
      • This owner field should be mapped to “impersonateas” field in the destination component, so that internally the share request will be executed under owner context.
      • Batch size should be 1 in the Dynamics CRM Destination component, otherwise it will not process all the records.

This process is same to migrate personal charts (userqueryvisualization) and dashboards (userform) also. Hope this information is helpful.

Migration of POA (shares) of personal views/charts/dashboards

In our project we got a requirement to migrate shares of personal views. We all know that share information will be stored in “principalobjectaccess” table. I faced couple of issues while migrating this data and I want to share this information here.

Issue 1: You can’t share a personal view owned by other user. To solve this issue, Kingsway soft provided a field called “impersonateas” which should be mapped to owner of the personal view (you can get this information by join the userquery table with POA table). So that the share request will be executed under owner context.

Issue 2: After Issue 1 is fixed we faced another weird issue that the package is only processing only 1 share in target instance irrespective of no.of records from the source. After a bit of research, we identified this is because of the “Batch Size”, after changing the batch size to 1 with out any threads it processed all the records from the source. I hope it is because of the impersonation we are using in the package.

I hope this information helps some one who wants migrate sharing information of persona views/charts/dashboards.