« Automate Case Updates to Customers in Microsoft Dynamics CRM | Main | Developing Dynamic SQL with Parameters - and Testing in SQL Query Analyzer. »

July 03, 2008

Leveraging Multi-tenancy for Instant Sandbox Creation

One of the neatest things I've learned to do with the multi-tenancy features in Dynamics CRM 4.0 is to rapidly create a sandbox Organization complete with data from an existing Organization's deployment. This is pretty awesome when you want to try out new configurations or develop against something with meaningful data, but don't want to go through the whole process of setting up a whole new CRM deployment (and then having to load data through manual entry or a migration process). It should be noted that to use multi-tenancy, you'll need the Enterprise version of Dynamics CRM.

The General Process

Basically, what I'm doing is creating a new copy of an existing organization's MSCRM database and importing it as a new Organization in CRM. Obviously, the main thing to deal with is renaming the database since you cannot have two identically named databases on the same SQL Server instance. Also, Organization names in CRM 4.0 are not quite as hard-coded everywhere as they were in previous versions. After the jump, I'll demonstrate to steps...

Copy the Original Database

Here's a super-cool trick to making database copies in SQL Server:

  1. Open SQL Server Management Server and connect to the desired SQL instance with the Object Explorer
  2. This trick assumes you already have a backup of the original database. If you do not, make a quick backup:
    1. Right-click the database you want to copy and select Tasks > Back Up...
    2. Accepting the defaults here is fine (unless you need to change the location of the backup set) so click OK.
  3. Now, right-click the Databases folder in the Object Explorer and select Restore Database.
    1. In the Destination for restore section, specify your new name for the database. I use Sandbox_MSCRM. The default restore point is fine.
    2. In the Source for restore area, select From database and then select the source database from the drop-down menu.
    3. Next, select the backup set to restore. If there is only one, then it will automatically be selected.
    4. The Restore Database Wizard will automatically change the database file names to match the new database name.
    5. Click OK.
      clip_image002
  4. If if there are no problems, you'll see a confirmation message that the database has been successfully restored.

Import the New Organization

So, now that we have our Sandbox MSCRM database, we can now import the Organization in CRM as a Sandbox organization:

  1. On the CRM server, open the CRM Deployment Manager.
  2. Right-click on the Organizations folder and select Import Organization.
  3. Next, enter the SQL server name. The Deployment Manager should automatically detect any valid CRM databases that are not already imported (Note: It will not recognize any 3.0 databases):
    image
  4. Now you'll be able to name your "new" organization. I almost always use "Sandbox" when setting up these playground environments, but use whatever makes sense to you:
    image
  5. After you've named your new organization, you'll need to specify the report server:
    image
  6. Now you get to specify how you would like to handle the users in the organization. You have a few options here, I'll leave the specifics to the Implementation Guide, but generally, I always keep existing user mappings:
    image
  7. Next, you get a chance to edit the existing mappings before the import:
    image
  8. System Requirement Check Time!!!111!:
    image
  9. Click Finish and watch the wizard work some magic:
    image

So, that's it. You should now have a fully functional sandbox organization that is completely identical to your production one (until you change it, that is...). While not quite an "instant" process, I've been able to perform the above procedure in about 5 minutes. The biggest factor that impacts the time needed to run through this is the size of your database.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e54fb34b6f883300e55383fb348833

Listed below are links to weblogs that reference Leveraging Multi-tenancy for Instant Sandbox Creation:

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Great post! If I make configuration changes in the Sandbox how do I get those into my production server? Do I have to manually redo the configurations or is there an easier way??
Also, do you have any recommendations for setting up a sandbox environment using the Professional edition? Would using a virtual server work?
Thanks

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

CustomerEffective is a Microsoft Gold Certified Partner specializing in Customer Relationship Management (CRM) implementation, development and integration. We help organizations improve profitability through automation of sales, service and marketing processes.

Twitter Updates

    follow me on Twitter

    Search The Blog

    • Search the Blog
       

      WWW
      blog.customereffective.com
    Subscribe to this blog's feed

     Subscribe in a reader

    Add to Google Reader or Homepage

    Enter your email address:

    Delivered by FeedBurner