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?

1/16/2013 9:45:16 AM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

Actually mojodb is the database name. Is that bad?

Q. Are you sure that [mojodb].[dbo] is not the owner prefix?
A. How do i determine if it is?

Q. Are you sure there is not another copy of the same table with a different owner prefix and different data?
A. I have scrolled through the list of tables and I am 100% certian that there are no duplicates.

 

1/16/2013 9:58:42 AM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

Out of all the mojoPortal installations on godaddy it is very unlikely that yours has the database named mojodb. I think godaddy has changed something about your database user after your initial installation and I think there does exist another table named mp_SchemaVersion but your user no longer sees this table so it created a new one with its new prefix and therefore it cannot coorectly determine what version it is upgrading from so it tries really old scripts.

I would get a backup of your db and restore it on a local machine, then inspect it as  admin aka sa user to see if it does have multiple copies of one or more tables with different owner prefixes.

When you view a tables using SQL Server Management tools the own prefix is visible as shown below:

sql owner screenshot

I suspect you have some tables duplicated with different owner prefixes and the db user cannot see the ones with the other/older owner.

1/16/2013 9:59:24 AM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

the real database name would be in the connection string in user.config

1/16/2013 10:11:17 AM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

Here is the user.config file:

<?xml version="1.0" encoding="utf-8"?>
<appSettings>
  
  <!-- 
  IMPORTANT:
  Note that changes made to this file are not automatically detected by the ASP.NET runtime
  It does detect changes to Web.config, so when you make a change in this file you need to touch Web.config (ie type a space in it and save it)
  to make it reload settings
  -->

  <add key="MSSQLConnectionString" value="server=mojodb.db.2243892.hostedresource.com;UID=mojodb;PWD=**********;database=mojodb" />

  <add key="MySqlConnectionString" value="Server=localhost;Database=mojoprod;Uid=root;Pwd=Charset=utf8;" />

  <add key="PostgreSQLConnectionString" value="Server=localhost;Port=5432;User Id=postgres;Password=;Database=mojo;Encoding=UNICODE;" />
  
  <add key="FirebirdConnectionString" value="Data Source=localhost;Server Type=0;Port Number=3050;Database=C:\mojoportal\mojoportal.fdb;Dialect=3;Charset=UTF8;Pooling=True;Min Pool Size=0;Max Pool Size=200;Connection Timeout=10;Connection Lifetime=60;Fetch Size=200;User Id=SYSDBA;Password=masterkey" />

  <!--
            you can use a fully qualified file path as shown below
            or if you are using the default db at /Data/sqlitedb/mojoportal.db
            just leave this set to "defaultdblocation"
        <add key="SqliteConnectionString" value="version=3,URI=file:C:\\Projects\mojoportal\Web\Data\sqlitedb\mojoportal.db" />
        -->

  <add key="SqliteConnectionString" value="defaultdblocation" />


  <!-- if running in medium trust uncomment this
    <add key="RunningInMediumTrust" value="true" />
    -->

  <add key="ImageGalleryUseMediaFolder" value="true" />
  <add key="GreyBoxCssIsLoadedFromSkin" value="true" />
  
  
  <add key="DisableSearchFeatureFilters" value="false" />
  <add key="SearchUseBackwardCompatibilityMode" value="false" />
  <add key="EnableSearchResultsHighlighting" value="true" />
  <add key="SearchIncludeModuleRoleFilters" value="true" />
  <add key="Forum:AggregateSearchIndexPerThread" value="true" />
  
  <add key="UseLegacyCryptoHelper" value="false" />
  
<add key="DisableDotNetOpenMail" value="true" />
<add key="SMTPServer" value="relay-hosting.secureserver.net" />
<add key="SMTPRequiresAuthentication" value="false" />
<add key="SMTPUseSsl" value="false" />
<add key="SMTPPort" value="25" />
<add key="SMTPUser" value="" />
<add key="SMTPPassword" value="" />
  

</appSettings>

1/16/2013 10:13:57 AM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

Here is screen shot of name.

www.eriemultimedia.com/dbase_name.jpg

1/16/2013 10:18:03 AM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

ok, forget about the name. Get a backup as mentioned and restore it locally and look very carefully for duplicate tables with different owner prefixes.

1/16/2013 10:41:24 AM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

Joe -

Thanks again for sticking with me!

Can you please point me to a resource that explains it or tell me how to restore the backup database locally?

I have never done this before.

1/16/2013 10:48:53 AM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

Create a new db in sql managment tools, it doesn't have to be named the same.

Then right the new db click and choose  Tasks > Restore > Database

from there you browse to the backup file, in settings choose to overwrite the existing db

Hope that helps,

Joe

1/16/2013 11:03:03 AM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

Joe -

what is "sql managment tools"? Can I donwload it some where? A google search isn't returning anything definitive.

G

1/16/2013 11:17:06 AM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

It is usually installed at the same time when you install sql server or sql server express, so if that is already installed you should find it in the programs menu. If you have not yet installed sql express, the easiest way to install it is using the MS Platform Installer.

1/16/2013 12:35:41 PM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

This turning into my worst nightmare. I have Windows XP and Windows 8 machine and it wont install on either of them.

Is there any way I can roll the site back to teh old install with just the backup of the database?

1/16/2013 12:45:55 PM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

You would need to have GoDaddy restore the db, but the file system also needs to be restored exactly as it was before the upgrade, which would requiring having a backup of the file system, deleting all the current files then restoring them from the backup.

If you can get the backup of the current db to me I can try to restore it here and take a look to confirm the problem suspicions and that "may" lead to an idea to solve it. You could zip it, put it on your server and send me a link at joe dot audette at g mail dotcom, then remove the file after I get it so no-one else can get the file.

You should be able to install on Windows 8 using platform installer unless it conflicts with an existing slq server installation on the machine. xp is pretty useless at this point.

It would be best to make a copy of both the db as it is currently and the one before upgrade available to me so I could compare them, but I would definitley want the backup of the db as it is right now.

I promise to delete the files after my investigation is complete.

1/16/2013 12:59:42 PM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

Joe - Thank you so much! I really appreciate you taking a look!

I sent you the link via the form on http://www.joeaudette.com

Best,

G

 

1/16/2013 1:29:09 PM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

Based on the mp_SchemaScriptHistory table, it looks like your old version is 2.3.5.5. I have no idea how it got changed to an older version in mp_SchemaVersion table but that is why it is trying to run older scripts that it should not run.

Run this against your db to correct it in mp_SchemaVersion, then visit the setup page again.

UPDATE mp_SchemaVersion
SET Major = 2, Minor = 3, Build = 5, Revision = 5
WHERE ApplicationID = '077E4857-F583-488E-836E-34A4B04BE855' 

That should make it start running upgrade scripts greater than version 2.3.5.5

That is still a pretty old version to upgrade from, you should also review all the release notes in the blog for versions from that one up to the latest and you will likely also need to make skin changes per the important skin changes article.

Hope that helps,

Joe

1/16/2013 1:44:28 PM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

Thanks a million! I can't wait to try this but I want to make sure I don't mess anything up.

Do i just change the existing values to these:

SET Major = 2, Minor = 3, Build = 5, Revision = 5

or do i actually need to "run" a script some how. My editor allows me to just click and edit the numbers. Is that OK?

TIA

 

1/16/2013 1:54:32 PM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

yes, you can set it manually on the mojoportal-core row, but make sure it is still there after you leave that row, ie it doesn't actually change until you get out of that row.

I assumed you could run a sql script since you previously posted a sql select statement.

1/16/2013 2:10:23 PM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

Joe, you are the man!

That did it!

THANK YOU! THANK YOU! THANK YOU!

G

1/16/2013 2:15:50 PM
Gravatar
Total Posts 18439

Re: database core schema needs upgrade.

Glad I was able to help! Many thanks for the generous beer donation!

Cheers,

Joe

1/16/2013 2:24:15 PM
Gravatar
Total Posts 37

Re: database core schema needs upgrade.

You are very welcome - If we every meet I will give you some Australian stuff - you will never be the same!

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