Home > CRM 2011 > CRM 2011 Import Organization on the same server

CRM 2011 Import Organization on the same server

I do not know if some of you were like me at the time you were wondering how can it be possible to import a CRM organisation on a same server.
That was my case actually and was fighting days until having the right answer given by Pavel Brestovsky

Actually the idea was that the only thing I get from a previous CRM deployement was the Organisazion_MSCRM database backup. As my original server has crashed, I could not import organisation from it.

How to do then ?

Here is the trick :

  • Restore you previous CRM backup database into a new one named for instance MYCRM ( hopefully you get a backup
  • run the following querries on the new created database MYCRM

SELECT ‘ALTER TABLE ‘+QUOTENAME(name)+’ NOCHECK CONSTRAINT ALL’
FROM sysobjects WHERE xtype=’U’ and uid=1

declare @newid uniqueidentifier

select @newid = newid()

SELECT 
        ‘Update ‘ + c.TABLE_SCHEMA + ‘.’ + c.TABLE_NAME + ‘ set ‘ + c.COLUMN_NAME +’ =”’ + +cast(@newid as varchar(40))+””
    FROM INFORMATION_SCHEMA.Columns c
        INNER JOIN INFORMATION_SCHEMA.Tables t
        ON c.TABLE_NAME = t.TABLE_NAME
        AND t.TABLE_TYPE = ‘BASE TABLE’
    WHERE DATA_TYPE = ‘uniqueidentifier’  and column_name=’organizationid’

SELECT ‘ALTER TABLE ‘+QUOTENAME(name)+’ CHECK CONSTRAINT ALL’
FROM sysobjects WHERE xtype=’U’ and uid=1

 This script return 3 result set that must be executed on the new database to change the OrganisationId. Organisation Id is the trick, without a new ID the Deployement manager import wizard will not identified a new organisation on the server.

  • run the 3 results querry on new created database MYCRM
  • import organization from new database MYCRM  with different name than original organization

Tada, here we go.

Thnaks again to Pavel Brestovsky helping me on this issue.

Advertisements
Categories: CRM 2011
  1. December 11, 2011 at 12:55 am

    Hi,

    this post is not correct at all. Look at the msdn post again for my answer (frenkiesmart) and update your post. It made me a lot of trouble 😦 But it also gave me some ideas how to solve it 🙂

    http://social.microsoft.com/Forums/en-US/crmdeployment/thread/b8dfb946-bb02-4fb9-a92f-22ffb8b7071c/

    Thanks

    • Serge
      December 14, 2011 at 7:30 am

      What mistake did you notice in my post ? In my case doing is as describe solved my issue. I did not mentionn anywhere it will solved all issues.
      Thanks for your feedback
      Serge

  1. No trackbacks yet.

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

%d bloggers like this: