Moving MojoPortal problem

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.
11/18/2014 7:55:24 AM
Gravatar
Total Posts 78

Moving MojoPortal problem

Hi,

I have a MojoPortal installation and need to test it on another server. This is what I have done so far : 

  1. Backup MySQL database with MySQL Workbench
  2. Change the Use in the bak file to the name of the new My SQL database
  3. Download all current files for the site
  4. Change the web.config to point to the new database
  5. Upload the MojoPortal files
  6. Browse the preview url from the servern
  7. After a while this is shown : 

Welcome to mojoPortal Setup

Undersöker system...
Rättigheter för filsystemet ok.
MySQL databasanslutning ok.
databasrättigheter är tilläckliga för att ändra schema.
initialt databaschema behöver skapas.
Kör script mojoportal-core - 2.2.7.8 - 00:00:00.5304000
MySql.Data.MySqlClient.MySqlException (0x80004005): Can't create table '201552-orbitsupport.mp_Pages' (errno: 121) at MySql.Data.MySqlClient.MySqlStream.ReadPacket() at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId) at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() at MySql.Data.MySqlClient.MySqlScript.Execute() 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:00.6708000
Kör script mojoportal-core - 2.2.1.5 - 00:00:00.7488000
An Error Occurred:Table '201552-orbitsupport.mp_SchemaVersion' doesn't exist
Source:MySql.Data
Stack Traceat MySql.Data.MySqlClient.MySqlStream.ReadPacket() at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId) at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlHelper.ExecuteReader(MySqlConnection connection, MySqlTransaction transaction, String commandText, MySqlParameter[] commandParameters, Boolean ExternalConn) at MySql.Data.MySqlClient.MySqlHelper.ExecuteReader(String connectionString, String commandText, MySqlParameter[] commandParameters) at mojoPortal.Data.DBPortal.SchemaVersionGetSchemaVersion(Guid applicationId) at mojoPortal.Data.DBPortal.SchemaVersionExists(Guid applicationId) 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)

Why? I have tried to drop tables and take a new backup of current database but still the same problem? 

11/18/2014 9:15:13 AM
Gravatar
Total Posts 78

Re: Moving MojoPortal problem

I have checked the Views, Stored Procedures and Functions but there is none? Not even in the working database? Is it true that there are no SQL objects here? Only Tables?

Im using MySQL Workbench and this is also the tool I used for Data Export and Data Import/Restore. No errors was thrown durring backup or restore.

11/18/2014 1:38:50 PM
Gravatar
Total Posts 115
mojoPortal Community Expert

Re: Moving MojoPortal problem

First I would read over this. It is a good general overview of moving a mojoPortal installation.

In your step 3 you mention downloading files for the site, are you downloading a fresh copy of mojoPortal or actually moving the folders and files for your current install? You should not try to move and upgrade at the same time.

11/19/2014 3:18:52 AM
Gravatar
Total Posts 78

Re: Moving MojoPortal problem

Hmm I get no mail from your update :(

Anyway, I read that link before I moved my webpage and im not doing a upgrade, im downloading webpage from current server with FTP and then upload them to the new server with FTP.

Is it true that mojoPortal do not have any StoredProcedures?

I have tried the procedure 3 times now, even tried exporting/importing database but still it tries to run the setup?

11/19/2014 7:31:13 AM
Gravatar
Total Posts 18444

Re: Moving MojoPortal problem

"Is it true that mojoPortal do not have any StoredProcedures?"

yes, that is true of the MySql version

one thing about MySql, on Linux table names are case sensitive, on Windows they are not and this can cause problems when moving a db from one server to another. For example on Windows to compensate for this difference, some configurations will force all lower case table names, then if you backup the db from windows and restore it on linux the lower case table names are not what mojoportal is looking for.

For a new install on linux MySql db, the tables will be camel cased like mp_Sites, mp_Pages, mp_UserProperties, but on Windows they will get often get changed to mp_sites, mp_pages, mp_userproperties. Then if you backup from windows and restore on linux mysql you need to manually rename them back to camel case or mojoPortal does not see the tables and starts trying to create them again but then errors happen.

It sounds like this is the problem in your case.

11/19/2014 7:45:39 AM
Gravatar
Total Posts 78

Re: Moving MojoPortal problem

Thanks,

Im sure that both environments are Windows but I took a extra look in the MySQL Workbench and all the names(in both databases) is in lowCase?

11/19/2014 8:16:29 AM
Gravatar
Total Posts 18444

Re: Moving MojoPortal problem

it seems like something about your MySql environment expects all the tables to have an owner prefix 

201552-orbitsupport.mp_SchemaVersion but the sql dump form the previous db does not export tables like that

to be honest I'm not really sure what the problem is, you probably should ask your host for help. In my installlations and environments I do not have an owner prefix like that, when it looks for tables it just looks for the table name mp_SchemaVersion

for example your error:

An Error Occurred:Table '201552-orbitsupport.mp_SchemaVersion' doesn't exist

does the table exist? does it have data? is it named that way with "201552-orbitsupport." at the beginning? if not can you name it that way manually?

11/19/2014 8:25:42 AM
Gravatar
Total Posts 78

Re: Moving MojoPortal problem

The old database was named orbitsite, the new database is named 201552-orbitsupport so I suspect that it works just like MSSQL : [Database].[Table]?

This is how select from old database looks like : 

SELECT * FROM orbitsite.mp_schemaversion;

And new : 

SELECT * FROM `201552-orbitsupport`.mp_schemaversion;

Both workse fine to execute but its only the "old" MojoPortal site that works.

11/19/2014 8:44:52 AM
Gravatar
Total Posts 18444

Re: Moving MojoPortal problem

What I would do is this

1. create a new empty db at the new environment and set the connection string to the new db

2. visit the setup page, it should create all the tables just like a new installation

3. compare very carefully how things got named vs how things are named in the migrated db, both table names and column names

normally since the connection string has the database name the database name is not used in select statements even on MS SQL (except in query analyzer where it can see all the databases) what you more commonly see is dbo.tablename (default db owner) or foo.tablename (custom db owner prefix) which refers to the db owner. In MySql there are corresponding constructs and owner name could be the same as database name which makes you think it is using database name

I'm thinking the newly installed db will work and you can learn from it what it doesn't like about the migrated db (there msut be something about the way things are named) and then try to correct it and then change the connection string to the migrated db.

I'm guessing the new db will have owner name as part of the table names and you may need to manually rename the existing tables in the migrated db to make it happy,

11/19/2014 9:10:18 AM
Gravatar
Total Posts 18444

Re: Moving MojoPortal problem

"Im sure that both environments are Windows but I took a extra look in the MySQL Workbench and all the names(in both databases) is in lowCase?"

ok if you are 100% sure about both being windows, but the fact that both have lower case does not lead to conclude that. The export machine was windows so it exported lower case and the new machine even if it is linux imported lower case from the sql dump because that is what was in the sql dump but it would be a problem on linux and it would explain the current problem and the fix would be renaming back to camel mixed case

11/20/2014 7:26:22 AM
Gravatar
Total Posts 78

Re: Moving MojoPortal problem

Yes, its possible that the MySQL server is a Linux server that would make sense based on the name. But renaming all 128 tables manully just to see how the enviroment works at the new host sounds like alot of work? Is there any other way? Why are not mojoPortal simple using lowcase always?

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