locked
Problems when importing the second organisation on same server RRS feed

  • Question

  • Since CRM 4.0 allows multi-tenancy, it should allow us to create an environment which has the dev organisation and test organisation on the same CRM 4.0 server.

    However we are experiencing problems when importing the second organisation in the above mentioned environment.

    we keep getting error below:

    System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object
    'dbo.SystemUserOrganizations' with unique index
    'SystemUserOrganizations_CrmUserId'.

    Any help as to why the import wizard seems to not manage to map the new
    users?

    Thanks

    Thursday, October 25, 2012 8:58 AM

Answers

  • One option that works in CRM 2011 and may do in CRM 4.0 but is only suitable for dev or test environments not live is to import the org once (eg CRM_dev), then disable and delete it from Deployment Manager - the database remains in place in SQL. Import again with a new name (CRM_Test) and it should allow you past the error about duplicate IDs. Now reimport the first one, from the database that is still on the SQL server. It will simply "reactivate" and not need to do a full "import" process.

    On CRM 2011 this seems to get round the issue when doing upgrades, and only runs the upgrade process once on each (the second time you import org 1 it is already an upgraded org).

    This might not work on CRM 4.0 but is pretty easy to try, so you will soon find out if it works!

    This method leaves some of the original ID references in the org, so may have problems in a live environment (specifically with email router, I am told, as well as things like special views eg "users with no security role" which seem to be shown for the first org installed whichever org you are looking at.

    Let us know how you get on!


    Hope this helps. Adam Vero, Microsoft Certified Trainer | Microsoft Community Contributor 2011

    • Marked as answer by Robert Cassar Thursday, November 1, 2012 10:30 AM
    Thursday, October 25, 2012 4:12 PM

All replies

  • Do you try to import a backup of an existing organization as a new organization in the same deployment? if so, I guess it is not allowed since ids are the same for organizations and users

    My blog : http://mscrmtools.blogspot.com


    New tools available!
    Iconator |  Solution Extender  |  Web resource manager

    Thursday, October 25, 2012 9:32 AM
    Moderator
  • well this is what we are trying to do.

    We have a live CRM server with 1 organisation on it. This is working fine.

    We have another server which is fresh installation of CRM, on which we are trying to import 2 organisations (dev and test).

    The dev and test will both start off as an exact copy of the live organisation on which we will apply customisations and test them before deploying on live.

    We have already managed to import a copy of the live organisation to serve as the DEV organisation and this is working fine.

    However when we tried importing another copy of the live organisation to serve as the test organisation, we keep getting errors (like the one mentioned earlier).

    So in a nut shell, all the 3 organisations are the same. 2 of which need to be installed on the same server.

    We have rollup 14 installed on both servers.

    Hope this clarifies the situation.

    Thanks


    Thursday, October 25, 2012 9:41 AM
  • It does, but you can't import the same organization twice in the same deployment.

    The same question was already asked: so look at http://social.microsoft.com/Forums/en-US/crmdeployment/thread/6e6a5bd7-b58a-4a62-a8fb-7b9d666efe92


    My blog : http://mscrmtools.blogspot.com


    New tools available!
    Iconator |  Solution Extender  |  Web resource manager

    Thursday, October 25, 2012 9:44 AM
    Moderator
  • yes that link is the same one as this. it is looping back to this same post.
    Thursday, October 25, 2012 9:47 AM
  • Don't know if i misunderstood but i don't think it is the same..

    first of all in the link you posted, they are upgrading from CRM 4 to CRM 2011 and secondly the errors are different.

    Thursday, October 25, 2012 11:30 AM
  • Ok I thought that maybe it could drive you to a solution...

    So try this one but remember: In a supported way, it can't be done! http://social.microsoft.com/Forums/en/crmdeployment/thread/b8dfb946-bb02-4fb9-a92f-22ffb8b7071c


    My blog : http://mscrmtools.blogspot.com


    New tools available!
    Iconator |  Solution Extender  |  Web resource manager

    Thursday, October 25, 2012 11:56 AM
    Moderator
  • thanks. even though i had tried this option, i will try it again maybe it will work this time round.
    Thursday, October 25, 2012 12:20 PM
  • One option that works in CRM 2011 and may do in CRM 4.0 but is only suitable for dev or test environments not live is to import the org once (eg CRM_dev), then disable and delete it from Deployment Manager - the database remains in place in SQL. Import again with a new name (CRM_Test) and it should allow you past the error about duplicate IDs. Now reimport the first one, from the database that is still on the SQL server. It will simply "reactivate" and not need to do a full "import" process.

    On CRM 2011 this seems to get round the issue when doing upgrades, and only runs the upgrade process once on each (the second time you import org 1 it is already an upgraded org).

    This might not work on CRM 4.0 but is pretty easy to try, so you will soon find out if it works!

    This method leaves some of the original ID references in the org, so may have problems in a live environment (specifically with email router, I am told, as well as things like special views eg "users with no security role" which seem to be shown for the first org installed whichever org you are looking at.

    Let us know how you get on!


    Hope this helps. Adam Vero, Microsoft Certified Trainer | Microsoft Community Contributor 2011

    • Marked as answer by Robert Cassar Thursday, November 1, 2012 10:30 AM
    Thursday, October 25, 2012 4:12 PM
  • Hi Robert,

    Have you tried set the registry key OptimizeOrgImport to 0?

    1. Click Start, click Run, type regedit, and then click OK.
    2. Locate and then click the following registry subkey:
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM
    3. Right-click MSCRM, point to New, and then click DWORD Value.
    4. Name this DWORD value as "OptimizeOrgImport"
    5. Right-click OptimizeOrgImport, and then click Modify.
    6. In the Value data box, type 0 and then click OK.
    7. On the File menu, click Exit.

    You can't import the same database/organization if you have the OptimizeOrgImport enabled.


    Visit my blog for CRM material, improving performance, kerberos, IFD, development tips, etc. :) http://quantusdynamics.blogspot.com


    Monday, October 29, 2012 9:51 PM
    Answerer
  • Hi nrodri

    thanks for the interest. Yes we have tried that option aswell. however when we set it to 0, the process took too long. (overnight) and it was still not finished.

    Tuesday, October 30, 2012 7:30 AM
  • Hi,

    that's good, that's the only way to import the same organization with a different name. If it's running for a long period of time, that would be related with your servers and the size of your database.

    You can't import the same database twice with OptimizeOrgImport set to 1.


    Visit my blog for CRM material, improving performance, kerberos, IFD, development tips, etc. :) http://quantusdynamics.blogspot.com

    Tuesday, October 30, 2012 10:27 AM
    Answerer
  • we thought that running the map users for 14 hours was abit too much...
    Tuesday, October 30, 2012 10:42 AM
  • Try adding the key:

    Type: String
    Name: PreferredDC
    Value: DC_name

    This will force the use of a specific domain controller and may speed up things. It may take a while I'm aware, but per Microsoft documentation and KB's OptimizeOrgImport cannot be set to 1 for your requirement.

    How many users do you have to map?

    Also make sure you don't have any registry keys that may limit the number of rows/queries .


    Visit my blog for CRM material, improving performance, kerberos, IFD, development tips, etc. :) http://quantusdynamics.blogspot.com

    Tuesday, October 30, 2012 11:39 AM
    Answerer
  • we have around 85 users... will try the preferredDC registry key option and see..
    Tuesday, October 30, 2012 11:52 AM
  • in that case shouldn't take that long.

    You most likely have a deadlock on the database, before you import reset the services:

    • SQL
    • CRM Asynch services

    this will clear any deadlocks.


    Visit my blog for CRM material, improving performance, kerberos, IFD, development tips, etc. :) http://quantusdynamics.blogspot.com

    Tuesday, October 30, 2012 12:04 PM
    Answerer
  • @nodri

    there are no deadlocks on the server since the server is being restarted before the install.

    With regards to the PreferredDC, it will not apply in our setup as we only have 1 domain.

    @Adam Vero

    I have tried your solution of disabling the dev to import the test organisation. However when we go to re-import the dev, the process is stuck on the import users (taking too long). It has been stuck in the same sport for nearly 24 hours now. and with a user base of around 85, i doubt it is the size that is making it take long. Obviously we tried the process with both the OptimiseOrgID set to 1 and set to 0. both the same issue.

    I guess we have to trash the option of having the DEV and TEST on the same CRM server and have them installed on seperate servers.

    Thanks anyway for all you help.

    Thursday, November 1, 2012 8:43 AM
  • weirdly enough.. after over 24 hours of trying to map the users, and as i was just about to cancel the process, the import completed successfully. I now have 2 organisations on the same server.

    for future reference, this is what we have done...

    I used Adam Vero's suggestion to disable/delete the organisation, import the new one and re-import the first organisation. Throughout this process, OptimiseOrgId registry key was set to 0.

    thanks to all for your feedback.

    Thursday, November 1, 2012 10:30 AM
  • We've also tried all the options listed above except the one of deleting an existing org in the test environment, importing a new one and then re-enabling the original org.  When attempting to run with a OptimiseOrgId key set to 0 we ran out of space in the transaction log table.  We have ~650 users, though, and our account and contact table number in the 2.5 million.  Our transaction log hit 100 gb before it ran out of space. 

    Has anyone else ran out of space when performing this type of import? 

    Monday, February 11, 2013 5:32 PM
  • To be quite honest, it was going to be too much of hassle to have two organisations on the same crm server. especially when we need to refresh one of them with the data from live crm (for testing purposes). Infact we opted for 2 seperate servers (since we use virtual machines it was easier).
    Tuesday, February 12, 2013 7:39 AM
  • Of course the downside of using two servers is needing two CRM server licences (and Windows server, although this may be covered as a VM by using an enterprise edition licence, I'm not sure).

    If one of the servers is purely for dev/test then you could use an MSDN licence for this if you have a subscription.

    @Valter - you may get better responses to your specific scenario if you start your own thread. Link back to this one if you think it is relevant background, but allow people to answer one question at a time.


    Hope this helps.
    Adam Vero, Microsoft Certified Trainer | Microsoft Community Contributor 2011
    Blog: Getting IT Right

    Tuesday, February 12, 2013 9:23 AM