SqlException error after moving to my new machine

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
12/8/2011 11:04:13 PM
Gravatar
Total Posts 1

SqlException error after moving to my new machine

I am facing  the following problem while i moved my data base from one machine to an other. Please help me.Thanks

SQL SERVER 2008 Express ,Widows server 2003, IIS 6

Probing system...
File system permissions ok.
MSSQL database connection ok.
database permissions are sufficient to alter schema.
database initial schema already exists.
database core schema needs upgrade.
1 site(s) found.
Running script mojoportal-core - 2.3.6.6 - 00:00:00.1874964
An Error Occurred:Cannot insert the value NULL into column 'ID', table 'DevWeb.dbo.mp_SchemaScriptHistory'; column does not allow nulls. INSERT fails. The statement has been terminated.
Source:.Net SqlClient Data Provider
Stack Trace 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() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() 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.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteScalar() at mojoPortal.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, Int32 commandTimeout, SqlParameter[] commandParameters) at mojoPortal.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at mojoPortal.Data.SqlParameterHelper.ExecuteScalar() at mojoPortal.Data.DBPortal.SchemaScriptHistoryAddSchemaScriptHistory(Guid applicationId, String scriptFile, DateTime runTime, Boolean errorOccurred, String errorMessage, String scriptBody) at mojoPortal.Business.DatabaseHelper.AddSchemaScriptHistory(Guid applicationId, String scriptFile, DateTime runTime, Boolean errorOccurred, String errorMessage, String scriptBody) at mojoPortal.Web.UI.Pages.SetupHome.RunUpgradeScripts(Guid applicationId, String applicationName, String pathToScriptFolder, Version versionToStopAt) at mojoPortal.Web.UI.Pages.SetupHome.UpgradeSchema(String applicationName) at mojoPortal.Web.UI.Pages.SetupHome.RunSetup() at mojoPortal.Web.UI.Pages.SetupHome.Page_Load(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

12/9/2011 7:52:45 AM
Gravatar
Total Posts 18439

Re: SqlException error after moving to my new machine

You did not move the database correctly. You cannot just import the objects, when you do that it loses primary keys indexes and default values, etc for columns.

See Moving an Installation of mojoPortal to Another Server

The only way to move a database correctly is to get a backup and restore it or to use a tool that can correctly script off the database and the data, then run the script to restore it on the new database.

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.