locked
error while upgrading from MS crm 4.0 to crm 2011 RRS feed

  • Question

  • Hi,

    I tried to Upgrade MS crm 4.0 to MS CRM 2011.

    I did follow steps.

    1. I Took Backup of SQL Server of CRM 4.0.

    2. Restored the Backup on SQL 2008 64bit server.

    3. then tried to Import the Organization then it is giving error, Import failed please see error log file.

    4. in Log file it is giving error as mention below.

     

    Please help me in below Issue.

    Thanks in Advance....

    System.Data.SqlClient.SqlException (0x80131904): User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout, Boolean disablePool)
       at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)

    11:58:17|   Info| Setting organization state.  New state = Failed
    11:58:17|  Error| Upgrade Organization with Id=45d7b64b-4e80-49c1-9545-c5074d2a9cb7 failed with Exception:
    System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Data.SqlClient.SqlException: User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout, Boolean disablePool)
       at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.Installer.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationUpgrader.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
    11:58:17|  Error| An error occurred when trying import and upgrade organization database PNQSCRMT.23032013_MSCRM:
    Microsoft.Crm.CrmException: Upgrade Organization with Id=45d7b64b-4e80-49c1-9545-c5074d2a9cb7 failed with Exception:
    System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Data.SqlClient.SqlException: User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout, Boolean disablePool)
       at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.Installer.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationUpgrader.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo) ---> System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Data.SqlClient.SqlException: User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout, Boolean disablePool)
       at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.Installer.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationUpgrader.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
    11:58:17|  Error| Import Organization (Name=Demag, Id=45d7b64b-4e80-49c1-9545-c5074d2a9cb7) failed with Exception:
    Microsoft.Crm.CrmException: Upgrade Organization with Id=45d7b64b-4e80-49c1-9545-c5074d2a9cb7 failed with Exception:
    System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Data.SqlClient.SqlException: User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout, Boolean disablePool)
       at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.Installer.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationUpgrader.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo) ---> System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Data.SqlClient.SqlException: User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout, Boolean disablePool)
       at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.Installer.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationUpgrader.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Execute(Object obj)..................

    Wednesday, March 27, 2013 7:23 AM

Answers

All replies

  • The account you're using to import the organisation, is it an administrator on your SQL Server box? If not, please make sure it is and try it again.

    -

    Wednesday, March 27, 2013 11:21 AM
  • Hi,

    Thanks for reply.

    It is administrator account for both SQL box and Application Box.

    One more thing I would like to ask, we should take backup of main database of CRM 4.0 and restore it or should be take backup of all the database means metabase, config and reportserver and then restore it.

    Waiting for reply.

    Thursday, March 28, 2013 4:26 AM
  • Just the MYCRMORG_MSCRM database.
    Thursday, March 28, 2013 8:29 AM
  • hi Andrea,

    Thanks alot.

    Also can you update me on previous quire.

    Thursday, March 28, 2013 8:31 AM
  • Hi,

    I tried to Upgrade MS crm 4.0 to MS CRM 2011.

    I did follow steps.

    1. I Took Backup of SQL Server of CRM 4.0.

    2. Restored the Backup on SQL 2008 64bit server.

    3. then tried to Import the Organization then it is giving error, Import failed please see error log file.

    4. in Log file it is giving error as mention below.

    5. I am using Administrator account which has access both on SQL as well as application box..

     

    Please help me in below Issue.

    Is this error due to Timeout or some other error.

    Thanks in Advance....

    14:04:11|Verbose| Retrieving database version Provider=SQLOLEDB;Data Source=PNQSCRMT;Initial Catalog=23032013_MSCRM;Connection Timeout=60;Integrated Security=SSPI ...
    14:04:11|   Info| Database version: 4.0.7333.3135.
    14:04:11|   Info| Organization must be upgraded and imported
    14:04:11|   Info| Retrieved organization ID 45d7b64b-4e80-49c1-9545-c5074d2a9cb7.
    14:04:11|   Info| multipleTenancy for the deployment is True
    14:04:11|   Info| Retrieved organization ID 45d7b64b-4e80-49c1-9545-c5074d2a9cb7.
    14:04:11|Verbose| Checking Organization Id Data Source=PNQSCRMT;Initial Catalog=MSCRM_CONFIG;Integrated Security=SSPI ...
    14:04:11|   Info| Organization Id is unique
    14:04:11|   Info| UpdateOUGroupsInDatabase started
    14:04:11|   Info| PrivilegedUserGroupName = <GUID=968f26af-9680-47f5-9470-289b8c00a2cf>, SqlAccessGroupName = <GUID=b7ebd406-2871-417d-82e7-13db7bcae0e3>, ReportingGroupName = <GUID=34f47d3c-3f31-407e-9924-5d1672c961e1>, PrivilegedReportingGroupName = <GUID=f5b3daf8-6b24-4fe7-b270-24d6a269d43f>
    14:04:11|   Info| Granting access to CRM security groups for the deployment
    14:04:12|   Info| UpdateOUGroupsInDatabase finished
    14:04:12|   Info| Adding users to the config database
    14:04:13|   Info| System Administrator "Ajay Awale" with account IN_DCC\U08780 was added to the configDB successfully
    14:04:14|   Info| System Administrator "Abhijeet Patil" with account IN_DCC\U06298 was added to the configDB successfully
    14:04:17|   Info| System Administrator "DCCIN Administrator" with account IN_DCC\administrator was added to the configDB successfully
    14:04:17|   Info| System Administrator "Abhijit Mashale" with account IN_DCC\U08539 was added to the configDB successfully
    14:04:20|   Info| System Administrator "Ravin Wadhawan" with account IN_DCC\U05122 was added to the configDB successfully
    14:04:22|   Info| Update Organization...
    14:04:22|   Info| Setting organization state.  New state = Pending
    14:04:22|   Info| Installer Start: OrganizationUpgrader.Install: operation Upgrade
    14:04:22|   Info| Executing Install action: Microsoft.Crm.Tools.Admin.UpdateConnectionStringAction
    14:04:23|   Info| CrmAction execution time; UpdateConnectionStringAction; 00:00:00.0205086
    14:04:23|   Info| Executing Install action: Microsoft.Crm.Tools.Admin.BackupRolePrivilegesAction
    14:04:25|   Info| CrmAction execution time; BackupRolePrivilegesAction; 00:00:02.5469728
    14:04:25|   Info| Executing Install action: Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction
    14:04:25|   Info| Set Compatibility Level on database to SQL Server 2008
    14:04:25|   Info| CrmAction execution time; UpgradeDatabaseAction; 00:00:00.1533262
    14:04:25|  Error| Installer Complete: OrganizationUpgrader - Error encountered
    14:04:25|  Error| Exception occured during Microsoft.Crm.Tools.Admin.OrganizationUpgrader: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed.
    InnerException:
    System.Data.SqlClient.SqlException (0x80131904): User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout, Boolean disablePool)
       at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)

    14:04:25|   Info| Setting organization state.  New state = Failed
    14:04:25|  Error| Upgrade Organization with Id=45d7b64b-4e80-49c1-9545-c5074d2a9cb7 failed with Exception:
    System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Data.SqlClient.SqlException: User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout, Boolean disablePool)
       at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.Installer.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationUpgrader.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
    14:04:25|  Error| An error occurred when trying import and upgrade organization database PNQSCRMT.23032013_MSCRM:
    Microsoft.Crm.CrmException: Upgrade Organization with Id=45d7b64b-4e80-49c1-9545-c5074d2a9cb7 failed with Exception:
    System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Data.SqlClient.SqlException: User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout, Boolean disablePool)
       at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.Installer.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationUpgrader.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo) ---> System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Data.SqlClient.SqlException: User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout, Boolean disablePool)
       at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.Installer.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationUpgrader.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
    14:04:25|   Info| GetDBUpdateRevisionThresholdForServer(): Threshold = 1992.
    14:04:25|  Error| Import Organization (Name=Demag, Id=45d7b64b-4e80-49c1-9545-c5074d2a9cb7) failed with Exception:
    Microsoft.Crm.CrmException: Upgrade Organization with Id=45d7b64b-4e80-49c1-9545-c5074d2a9cb7 failed with Exception:
    System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Data.SqlClient.SqlException: User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout, Boolean disablePool)
       at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.Installer.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationUpgrader.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo) ---> System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Data.SqlClient.SqlException: User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
    User does not have permission to alter database '_3032013_MSCRM', the database does not exist, or the database is not in a state that allows access checks.
    ALTER DATABASE statement failed.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout, Boolean disablePool)
       at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.Installer.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationUpgrader.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.ImportAndUpgrade(OrganizationInfo organizationInfo)
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Execute(Object obj)

    Thursday, March 28, 2013 8:39 AM
  • I think you should start by checking your restored database.

    Can you access the database tables ?

    Have you restored it with a different name/path ?

    Then you should check your user's privileges :

    Minimum Permissions Required for Dynamics CRM 2011 Setup, Services, and Components

    Thursday, March 28, 2013 8:44 AM
  • Hi,

    Thanks Alot.

    I tried everything, also the Database table are accessible, and the database is restored on different database sever.

    When I tried Upgrated it at different server it has given me different error, please find below.

    Violation of PRIMARY KEY constraint 'PK__#CRMUser__59D492771BFD2C07'. Cannot insert duplicate key in object 'dbo.#CRMUserColumns'. The duplicate key value is (ActivityPointerBase, DeletionStateCode).

    Please help me on below issue.

    Since last 15 days I am trying to Upgrade to CRM 2011 but m getting different error each time.

    Can Anybody help me...

    Wednesday, April 3, 2013 5:00 AM
  • It might be because your database name starts with a numeric number "3032013_MSCRM" 

    I had the same issue with a database named "4X_MSCRM", I restored the database with an alpha character name "FourX_MSCRM" and the upgrade moved past that issue.

    Hope this helps.

    Nick


    Nick

    Saturday, June 15, 2013 2:24 AM