How to create a copy of your production CRM database for testing Resco Mobile CRM?

database_copies

Customers running on-premises installations of Microsoft Dynamics 365/CRM are eligible to have more than one database in their CRM environment. The most common reason for needing another database, is that you want to test changes and customizations in an environment mirroring your production database, but without affecting the live system. For example, to see how your Dynamics CRM will work with your Resco Mobile CRM client.

However, creating a copy of your production (live) database isn’t as straightforward as many would expect. Especially when you want to create a test organization on a separate server, that has not only the schema, but also the contents of your live CRM database. And if not created properly, the test organization can eat up Resco Mobile CRM licenses you want paired with your live system instead.

In Dynamics 365/CRM terminology, each database represents a distinct organization in CRM. The problem then lies in the organization’s unique ID. Just like other records, a CRM organization itself has a unique ID in addition to the name and display name visible in the Microsoft Dynamics CRM Deployment Manager. If this unique ID is identical for two organizations (or more), the Resco Mobile CRM licenses assigned to the live organization can also be used up by the test organization and cause a shortage of licenses available to your actual live CRM organization, as Resco licenses are assigned based on the unique ID.

So how do you properly create an identical copy of your live system, but with a different unique ID?

The situation is still fairly clear when creating a test organization on the same server that runs the live system: First, you need to create a copy of your production database. On your SQL Server machine, open up the SQL Server Management Studio, right-click on the production database and select Tasks – Copy Database. The Copy Database wizard will guide you through the process of creating an exact copy of your CRM database. Just give it a different name than the original database and point it to the same server.

Then open the Import Organization wizard in the Dynamics CRM Deployment Manager. Select the new database as the one you want to import, give your new organization a unique display name and database name, and accept the user mappings. From the copy of the production database you‘ve just created, the Deployment Manager will build a new organization with its own unique ID. You can then access this new organization by replacing the organization name in your existing CRM URL – e.g. changing http://server/demo1 to http://server/demo2.

Primarily for performance and security-related reasons, numerous companies create test organizations on servers separate from the one running the live system. However, if the database was copied directly from the live system to another server, the copy will have the same unique ID as the original production database. Because the database copy is stored on a separate server, the Import Organization wizard will not attempt to modify the ID. It will simply create a test organization with the same unique ID as has the live organization.

If you’ve already created a direct copy of your production database on another server, unfortunately, there is no official tool for modifying its unique ID. However, the Microsoft Dynamics community has come up with a solution. In one of the CRM Forum threads you can find a script that you can execute on your production database copy. This script will generate a new ID and update it to all the relevant tables, including the PrincipalObjectAccess table where the OrganizationID is titled as PrincipalID.

On the SQL Server, select the production database copy, right-click and choose New Query. Copy the script from the CRM Forum post and paste it into the query window. Make sure you have fresh backup copies of anything that’s valuable to you on the server. Then simply hit Execute to run the script.

From there, proceed with the Import Organization wizard in the Dynamics CRM Deployment Manager. Select the new database for import, give your test organization a unique display name and database name, etc. Then, the Deployment Manager will build a new CRM organization with an entirely unique ID.

This way you can make sure your test organization will always use only the predefined number of Resco Mobile CRM licenses and it won’t use up the licenses meant for deployment with your live Dynamics 365/CRM organization.

To assign any number of your Resco Mobile CRM licenses to your test organizations, simply contact us at mobilecrm@resco.net.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s