database core schema needs upgrade.

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
1/16/2013 2:23:26 AM
Gravatar
Total Posts 37

database core schema needs upgrade.

Hi All -

I have tried twice now to upgrade to the latest version. I seem to have all the files required but I continue to get the error below. Any help is greatly appreciated.

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.2.1.9 - 00:00:00.8112260
System.Data.SqlClient.SqlException (0x80131904): Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong. 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.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 mojoPortal.Data.SqlHelper.ExecuteNonQuery(SqlTransaction transaction, CommandType commandType, String commandText, Int32 commandTimeout, SqlParameter[] commandParameters) at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(String script, String overrideConnectionInfo) at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(FileInfo scriptFile, String overrideConnectionInfo) at mojoPortal.Business.DatabaseHelper.RunScript(Guid applicationId, FileInfo scriptFile, String overrideConnectionInfo) - 00:00:01.4976480
Note: This page shows some information that is helpful during setup and upgrades but for security it would be best not to show any information when the system is up to date. You can disable setup and suppress all information on this page by setting DisableSetup=true in Web.config. When you need to upgrade, you can set this back to false. If you are logged in as Administrator setup will run and you will be able to see this page even if it is disabled in Web.config so you can easily leave it disabled and just login before upgrading. But if you are not logged in you will need to enable setup in Web.config.

1/16/2013 7:23:59 AM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

Hi,

I think you are leaving out some information.

Did you "copy" the database or otherwise change to a different database or database server.

It should never run the script 2.2.1.9 unless upgrading from a 7 year old version of mojoPortal. Even a new installation starts at version 2.3.4.8.

Something is not right with your db and I suspect you did something like import the tables and procedures to another database which is not a valid way to backup and restore a db. To get a copy of an ms sql db you must make a backup using the sql tools and you must then restore that backup using the same tools to get a valid copy. Importing objects loses lots of imprtant things including primary keys, indexes and constraint.

Also when running install and upgrade scripts you should always have a db user that is dbo (database owner of the db) in the connection string. You generally should not use a diiferent user at a later upgrade.

Hope that helps,

Joe

1/16/2013 7:48:55 AM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

Hi Joe -

Thank you so much for the response!

I did not copy the database or change to a different database or database server. The new installation is running on the exact same hosting account as the old one.

I installed the new version of mojoPortal (mojoportal-2-3-9-4-mssql-net40-deploymentfiles.zip) over top of the old one. I did make a backup of the database per the install instructions.

I also did not change anything in the connection string.

Any more ideas are greatly appreciated.

Greg

 

1/16/2013 7:57:32 AM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

Do all the tables and procedures in your database have the dbo. prefix or not?

Is the table mp_SchemaVersion populated or not? What version does it say for mojoportal-core?

What version did you install originally?

Have you ever upgraded this installation before?

Who is your host? Is it possible they made some change after the original installation like it was installed with the db user as a dbo but they later changed it so your db user is no longer dbo?

1/16/2013 8:19:21 AM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

Q = Do all the tables and procedures in your database have the dbo. prefix or not?
A = Yes

Q = Is the table mp_SchemaVersion populated or not?
A = Yes. it has 12 entries

Q = What version does it say for mojoportal-core?
A = 8

Q = What version did you install originally?
A = I dont have this info - we created the site late 2011. 

Q = Have you ever upgraded this installation before?
A = No.

Q = Who is your host?
A = GoDaddy

Q = Is it possible they made some change after the original installation like it was installed with the db user as a dbo but they later changed it so your db user is no longer dbo?
A = I don't think so. It has "dbo" in the owner field of all tables.

Thanks again for sticking with me, Joe.

1/16/2013 8:27:48 AM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

Sorry - one answer i gave in incorrect: Here are the correct answers.

Q = Do all the tables and procedures in your database have the dbo. prefix or not?
A = If i am understanding you correctly - They do not have "dbo" as the prefix. Is the prefix the table name? Mine are all different. 

Here is an example:

Table    Owner    Date created    Filegroup    Rows
aspnet_Applicationsaspnet_Applications    dbo    09/17/2011 04:56:27 AM    PRIMARY    0 

Q = Is the table mp_SchemaVersion populated or not?
A = Yes. it has 12 entries

Q = What version does it say for mojoportal-core?
A = 8

Q = What version did you install originally?
A = I dont have this info - we created the site late 2011. 

Q = Have you ever upgraded this installation before?
A = No.

Q = Who is your host?
A = GoDaddy

Q = Is it possible they made some change after the original installation like it was installed with the db user as a dbo but they later changed it so your db user is no longer dbo?
A = I don't think so. It has "dbo" in the owner field of all tables.

Thanks again for sticking with me, Joe.

1/16/2013 8:32:36 AM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

"Q = What version does it say for mojoportal-core?
A = 8"

That isn't the full version what are all the numbers in sequence for mojoportal-core row?

1/16/2013 8:38:32 AM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

2218

1/16/2013 8:49:39 AM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

That does not make sense unless you really installed version 2.2.1.8 (highly unlikely since that version was released in 2007) or unless something deleted rows from that table before you tried to upgrade. Nothing built in to mojoPortal would ever do that.

That does explain why it is trying to run the script 2.2.1.9 but it makes no sense at all in the big picture. I cannot help without knowing the real version and even then it may be difficult without knowing the correct versions for all features listed in that table.

The only other thing that may help find out the real version is looking in mp_SchemaScriptHistory

Something very strange has happened to your db, this is not a normal upgrade.

If I knew the real version my advice would be to try deleting the older scripts up to and including the installed version script from under /Setup/applications/mojoportal-core/SchemaUpgradeScripts/mssql

That way it would start with the correct script. However if other rows have been deleted you may get similar problems with other features besides mojoportal-core and it may be very difficult to resolve it.

1/16/2013 9:08:58 AM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

Joe -

Man that sounds bad - I am getting worried.

here is a link to a screen shot of the mp_SchemsVersion table. I want to make sure I am telling you the right info.

www.eriemultimedia.com/schema.jpg

Here is a screen shot of the history.

www.eriemultimedia.com/schema_history.jpg

Thanks again for taking a look.

I owe you lots of beer!

G

 

1/16/2013 9:33:19 AM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

In your screen shot what is [mojodb] in the select * from [mojodb].[dbo].mp_SchemaVersion?

I cannot imagine that is the database name hosted at godaddy.

Are you sure that [mojodb].[dbo] is not the owner prefix?

Are you sure there is not another copy of the same table with a different owner prefix and different data?

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