locked
Unable to Import Organization in dynamics crm 4.0 RRS feed

  • Question

  • Hi all...

    I'm getting an error while importing an organization in CRM 4.0 into a new domain.  I have a new machine with a clean install of CRM 4.0 with latest rollup 9. I have also restored the MSCRM DB into SQL 2005.

    I ran the deployment manager and try to import the organization. I successfully mapped the users and completed all the steps. At the last step before installing it shows the list of things that have successfully done. Here I got a warning about the database:

    Warning: "The organization database selected for import is a different version than the organization database that is currently deployed."

    I continued with installation process and after about 15-20 min it is giving an exception.

    Exception: "Import Organization failed with Exception: System.InvalidOperationException: ExecuteNonQuery"

    I checked the log files and found this:

    Info| Import Organization (Camsoft)
    11:37:48|   Info| Update Organization...
    11:41:50|   Info| Update Users...
    11:46:21|  Error| Import Organization (Name=Camsoft, Id=0c8236bc-d437-df11-9e4d-00270e18cdb9) failed with Exception:
    System.InvalidOperationException: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.
       at System.Data.SqlClient.SqlConnection.GetOpenConnection(String method)
       at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
       at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate)
       at Microsoft.Crm.CrmDbConnection.SetTransactionIsolationLevel(IsolationLevel il)
       at Microsoft.Crm.CrmDbConnection.Dispose(Boolean disposing)
       at Microsoft.Crm.SqlExecutionContext.Dispose(Boolean disposing)
       at Microsoft.Crm.SqlExecutionContext.Dispose()
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Import(Guid organizationId, String organizationUniqueName, String organizationFriendlyName, String sqlServerName, String databaseName, Uri reportServerUrl, String privilegedUserGroupName, String sqlAccessGroupName, String userGroupName, String reportingGroupName, String privilegedReportingGroupName, ICollection`1 users, MultipleTenancy multipleTenancy)
    11:46:21|Warning| Attempting to cancel a long running process: ProgressWizard. This might leave the data in an invalid state and the application might not function correctly.
    12:01:04|Warning| Attempting to cancel a long running process: FinishWizard. This might leave the data in an invalid state and the application might not function correctly.
    12:01:39|   Info| Deployment Manager Exit

    The database file is very huge. it's around 70GB. So, I changed the registry entries like OLEDBTimeout etc., and tried but no luck.
    I reindexed the organization database and tried still getting the same error...

    I am using a professional crm edition and the database I am trying to import is of Enterprise crm edition.

    I tried in many ways but I couldn't find a solution. Could anyone give me a solution for this issue... It's highly appreciable...

    -Thanks


    Perfectionist
    Thursday, March 25, 2010 7:00 AM

Answers

  • I believe you can reverse on the server. The client version of v7 can't be reversed but that shouldn't affect you.

    Leon Tribe
    Want to hear me talk about all things CRM? Check out my blog
    http://leontribe.blogspot.com/ 
    or hear me tweet @leontribe


    Want to hear me talk about all things CRM? Check out my blog http://leontribe.blogspot.com/ or hear me tweet @leontribe
    • Proposed as answer by Leon TribeMVP Thursday, March 25, 2010 11:57 AM
    • Marked as answer by Jim Glass Jr Thursday, March 25, 2010 2:55 PM
    Thursday, March 25, 2010 11:56 AM
  • Hi,

    as your DB is 'big', make sure you have installed at least Rollup 8 and configured the OptimizeOrgImport setting. It looks like you are running in a timeout when remapping the records in the db to the new users. With Rollup 8, the remapping process was improved regarding this issue.

    See http://www.langalaxy.de/2010/02/common-errors-on-organization-import/ and http://support.microsoft.com/kb/977867

    As Leon already told, the 'new' error shows that you transaction log cannot grow anymore. If you resolve this issue, you will IMHO get the original problem again.

    • Marked as answer by Perfectionist Friday, March 26, 2010 6:29 PM
    Friday, March 26, 2010 2:48 AM

All replies

  • I'd try re-exporting from the original DB after installing RU9 on it. Different version, I'm guessing is referring to the rollup.

    Leon Tribe
    Want to hear me talk about all things CRM? Check out my blog
    http://leontribe.blogspot.com/ 
    or hear me tweet @leontribe


    Want to hear me talk about all things CRM? Check out my blog http://leontribe.blogspot.com/ or hear me tweet @leontribe
    • Proposed as answer by Leon TribeMVP Thursday, March 25, 2010 7:28 AM
    Thursday, March 25, 2010 7:28 AM
  • Hi Leon,

    I didn't get you. could you please tell me a bit detail?

    I am not sure of the latest rollup installed at the other end. I have installed a clean crm and rollup9 on my side.

    -Thanks

     


    Perfectionist
    Thursday, March 25, 2010 7:32 AM
  • If the org is from a CRM system which was not up to RU9 then I'm thinking, at some point the xml schema changed and this is the problem. Attach the DB to the original CRM or to one on an earlier rollup, upgrade and detach.

    Leon Tribe
    Want to hear me talk about all things CRM? Check out my blog
    http://leontribe.blogspot.com/ 
    or hear me tweet @leontribe 


    Want to hear me talk about all things CRM? Check out my blog http://leontribe.blogspot.com/ or hear me tweet @leontribe
    • Proposed as answer by Leon TribeMVP Thursday, March 25, 2010 8:11 AM
    Thursday, March 25, 2010 8:11 AM
  • Yes there is a difference in the rollups. The organization database I am trying to import is of rollup 5.

    can we uninstall a particular rollup???

     

    -Thanks

     


    Perfectionist
    Thursday, March 25, 2010 11:31 AM
  • I believe you can reverse on the server. The client version of v7 can't be reversed but that shouldn't affect you.

    Leon Tribe
    Want to hear me talk about all things CRM? Check out my blog
    http://leontribe.blogspot.com/ 
    or hear me tweet @leontribe


    Want to hear me talk about all things CRM? Check out my blog http://leontribe.blogspot.com/ or hear me tweet @leontribe
    • Proposed as answer by Leon TribeMVP Thursday, March 25, 2010 11:57 AM
    • Marked as answer by Jim Glass Jr Thursday, March 25, 2010 2:55 PM
    Thursday, March 25, 2010 11:56 AM
  • I cannot find that in Add Or Remove Programs. Can you suggest a way to uninstall?

     

    -Thanks


    Perfectionist
    Thursday, March 25, 2010 11:57 AM
  • How can i know which rollup is installed on my server?
    Perfectionist
    Thursday, March 25, 2010 12:04 PM
  • I have uninstalled rollup 9 and installed rollup5. Now the warning message is gone and I went on installation and I got a different exception.

    Exception:

    Error| Import Organization (Name=CambridgeSoftCorporation, Id=e4b84fca-1638-df11-be48-00270e18cdb9) failed with Exception:
    System.Data.SqlClient.SqlException: The transaction log for database 'CambridgeSoft_Corporation_MSCRM' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command)
       at Microsoft.Crm.Tools.Admin.DBImportHelper.UpdateSystemUserReferences(IDbCommand command, Guid oldSystemUserId, Guid newSystemUserId, Guid newAdObjectGuid, DomainAccount newAdDomainAccount)
       at Microsoft.Crm.Tools.Admin.DBImportHelper.UpdateSystemUserAndReferences(IDbCommand command, User user, Guid organizationId)
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Import(Guid organizationId, String organizationUniqueName, String organizationFriendlyName, String sqlServerName, String databaseName, Uri reportServerUrl, String privilegedUserGroupName, String sqlAccessGroupName, String userGroupName, String reportingGroupName, String privilegedReportingGroupName, ICollection`1 users, MultipleTenancy multipleTenancy)
    19:59:34|Warning| Attempting to cancel a long running process: ProgressWizard. This might leave the data in an invalid state and the application might not function correctly.

    When I checked for the below query

    select log_reuse_wait_desc,* from sys.databases

    it gives CHECKPOINT.

    What does it indicates???

     

    -Thanks


    Perfectionist
    Thursday, March 25, 2010 2:44 PM
  • It sounds like either the drive is out of space or the transaction log settings are not allowing to to grow.

    Leon Tribe
    Want to hear me talk about all things CRM? Check out my blog
    http://leontribe.blogspot.com/ 
    or hear me tweet @leontribe


    Want to hear me talk about all things CRM? Check out my blog http://leontribe.blogspot.com/ or hear me tweet @leontribe
    • Proposed as answer by Leon TribeMVP Thursday, March 25, 2010 6:10 PM
    Thursday, March 25, 2010 6:10 PM
  • Hi,

    as your DB is 'big', make sure you have installed at least Rollup 8 and configured the OptimizeOrgImport setting. It looks like you are running in a timeout when remapping the records in the db to the new users. With Rollup 8, the remapping process was improved regarding this issue.

    See http://www.langalaxy.de/2010/02/common-errors-on-organization-import/ and http://support.microsoft.com/kb/977867

    As Leon already told, the 'new' error shows that you transaction log cannot grow anymore. If you resolve this issue, you will IMHO get the original problem again.

    • Marked as answer by Perfectionist Friday, March 26, 2010 6:29 PM
    Friday, March 26, 2010 2:48 AM
  • Hi ckeller,

    Thanks for the solution...
    I have changed my transaction log file settings and installed the rollup8 and tried. The import organization works like a charm and its done in just 5min...

     

    -Thanks


    Perfectionist
    Friday, March 26, 2010 6:29 PM
  • I had the same issue... and got if fixed with the following process:

    Add the account you installed CRM with to the DBO schema for all CRM databases.

    The remaining steps I had to run through were:

    Step 1A) If you started an import and it is erroring out CLOSE the import wizard. Now start the process below:

    Step 1) From your orignal CRM Server (or whatever server SQL is installed on) Right click on your namexXX_MSCRM database and choose properties. ON the General TAB it will tell you WHO the owner is. Write down the Account name domain\user

    Step 2) On the new sql server or new SQL DB open a query window and run:

    Select accessmode,setupuser,firstname,lastname,isdisabled from systemuserbase order by lastname asc

    Find the user account you wrote down from step 1. ***Is the account disabled? (it would be set to a 1 if it is)

    Step 3)  Run a sql update command to enable the account on your new SQL server\restored db.

    example:

    Update systemuserbase set isdisabled='0' where firstname='John' and lastname='Doe'

    ***be sure you are selecting your user, not my example***

    Step 4) Start your import as normal. When you get an error about the Mapping find your user from step 1. Map that account to the Windows account that was used to install CRM probably Administrator.

     

    For failing to import see:  http://support.microsoft.com/default.aspx/kb/977867?p=1

    (Install CRM 4.0 Rollup 8 or higher, reboot, and apply registry fix)

    The other key part to fixing my problem is was installing rollup 8 or higher. There is a timeout value that causes the import to fail... once I did the above and installed the hotfix noted in the above URL my import was completed succesfully.

     

     

    Monday, March 29, 2010 7:05 PM
  • Could you let me what are the changes that you have done to the transaction log file settings.

    Regards,

    Jaipal

    Tuesday, May 8, 2012 7:44 AM
  • Hello Perfectionist,

    I am facing the same issue and tries oldtimeout,TCPip,MaxUserPort and TCPTimeWaitDelay .Still Facing same issue 

    18:14:36|   Info| Update Users...
    18:16:51|  Error| Import Organization (Name=test, Id=687fcace-43cf-e111-946c-005056a7007c) failed with Exception:
    System.InvalidOperationException: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.
       at System.Data.SqlClient.SqlConnection.GetOpenConnection(String method)

    Please let me know what have you done transaction log file settings.

    May be this will help me.

    Please support on this issue.

    Thanks & Regards,
    Vivek Gupta



    Tuesday, July 17, 2012 12:58 PM