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:
- Open SQL Server Management Server and connect to the desired SQL instance with the Object Explorer
- This trick assumes you already have a backup of the original database. If you do not, make a quick backup:
- Right-click the database you want to copy and select Tasks > Back Up...
- Accepting the defaults here is fine (unless you need to change the location of the backup set) so click OK.
- Now, right-click the Databases folder in the Object Explorer and select Restore Database.
- In the Destination for restore section, specify your new name for the database. I use Sandbox_MSCRM. The default restore point is fine.
- In the Source for restore area, select From database and then select the source database from the drop-down menu.
- Next, select the backup set to restore. If there is only one, then it will automatically be selected.
- The Restore Database Wizard will automatically change the database file names to match the new database name.
- Click OK.

- 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:
- On the CRM server, open the CRM Deployment Manager.
- Right-click on the Organizations folder and select Import Organization.
- 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):
- 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:
- After you've named your new organization, you'll need to specify the report server:
- 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:
- Next, you get a chance to edit the existing mappings before the import:
- System Requirement Check Time!!!111!:
- Click Finish and watch the wizard work some magic:
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.

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
Posted by: Sue | July 10, 2008 at 01:43 PM