Tuesday, November 17, 2009

Deploying an MSCRM 4.0 Test Environment with production data

1. You will need the most recent backups of the MSCRM_CONFIG and Org_MSCRM databases from your production environment.

2. Install MSCRM on the application server as a new installation with the same Organization name as the production environment.

3. Restore both backups directly over the newly created databases. It is very important that you do not make any changes to the data at this point because your test application server is pointing to your production database.

4. Run the following script on the test database to unorphan database users:

exec sp_change_users_login 'report'
declare @usrname varchar(100), @command varchar(100)
declare Crs insensitive cursor for

select name as UserName from sysusers
where issqluser = 1 and (sid is not null and sid <> 0x0)
and suser_sname(sid) is null
order by name

for read only
open Crs

fetch next from Crs into @usrname
while @@fetch_status=0

begin
select @command=' sp_change_users_login ''auto_fix'', '''+@usrname+''' '
exec(@command)
fetch next from Crs into @usrname
end

close Crs
deallocate Crs


5. Log onto the test application server and disable the Org that was just created.

6. Highlight the Organization and click edit.

7. In the next screen make the appropriate changes and run through the rest of the wizard. This usually takes up to 10 minutes to complete.

8. Open the table [Server] on the MSCRM_CONFIG database and change the servers from the production names to the test names.

9. Open the table [DeploymentProperties] on the MSCRM_CONFIG database and change the 2 entries of the production servers to the test servers. Run the following script against the MSCRM_CONFIG database to ensure everything is pointing to the correct place:

SELECT ConnectionString, SrsUrl FROM Organization


10. Go back to the Deployment Manager and re-enable the test Organization.

11. Finally, the last change that needs to be made is to export the isv.config and sitemap from the test CRM environment and edit in Notepad++. Find and Replace all references of the production CRM to the test CRM. Save those files and import them into the Test environment.

No comments:

Post a Comment