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 83

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 83

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 83

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 18439

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 83

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 18439

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 83

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 18439

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 18439

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 83

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?

11/20/2014 7:32:18 AM
Gravatar
Total Posts 83

Re: Moving MojoPortal problem

Im not sure what the real  camel mixed case is for these 128 tables(could not find any table description on mojoportal.com?) but I tried to rename one in MySQL Workbench (right click on table > alter table and then change the name and den save) but this says theat mp_AuthorizenetlLg are the same as mp_authorizenetlog ?

11/20/2014 8:09:08 AM
Gravatar
Total Posts 18439

Re: Moving MojoPortal problem

I told you run the setup page against an empty db, it will create the tables with the correct name and then you will have a reference on how the migrated tables need to be renamed.

Yes, its a bit of work maybe 30-45 minutes manually renaming tables, but if you want to solve the problem that is probably what it will take. 

if it gives trouble about it not being different then make the table name mp_AuthorizenetLogx, then rename it again without x. But honestly I would not expect linux to complain about those names not being different since it is case sensitive. So it casts a little doubt over whether that is the problem. Still it could be the tool that complains, and it is the only thing I know to try. I had to do it myself on this site many years ago.

yes in hindsight it would have been better to just use all lower case tables from the beginning, but I did not know about this difference in MySql on windows vs linux until a few years after mojoportal was originally developed and it is not the kind of thing you can fix later automatically and the problem rarely ever comes up, only a few times in the 10 years of mojoPortal existence that I know of.

11/20/2014 8:16:18 AM
Gravatar
Total Posts 18439

Re: Moving MojoPortal problem

note also that if running the setup on an empty db does not create mixed case tables then it rules out the idea of it being linux, but if it does then it confirms the diagnosis

11/21/2014 6:59:54 AM
Gravatar
Total Posts 83

Re: Moving MojoPortal problem

Thanks a lot! It worked after renaming so the MySQL server most be a Linux sever. The webserver is however a Windows Server and this was the reson to my misleading.

Here is the script I ran : 

RENAME TABLE 
mp_authorizenetlog to mp_AuthorizeNetLog,
mp_bannedipaddresses to mp_BannedIPAddresses,
mp_blogcategories to mp_BlogCategories,
mp_blogcomments to mp_BlogComments,
mp_blogitemcategories to mp_BlogItemCategories,
mp_blogs to mp_Blogs,
mp_blogstats to mp_BlogStats,
mp_calendarevents to mp_CalendarEvents,
mp_category to mp_Category,
mp_categoryitem to mp_CategoryItem,
mp_comments to mp_Comments,
mp_commercereport to mp_CommerceReport,
mp_commercereportorders to mp_CommerceReportOrders,
mp_contactformmessage to mp_ContactFormMessage,
mp_contenthistory to mp_ContentHistory,
mp_contentmeta to mp_ContentMeta,
mp_contentmetalink to mp_ContentMetaLink,
mp_contentrating to mp_ContentRating,
mp_contentstyle to mp_ContentStyle,
mp_contenttemplate to mp_ContentTemplate,
mp_contentworkflow to mp_ContentWorkflow,
mp_contentworkflowaudithistory to mp_ContentWorkflowAuditHistory,
mp_currency to mp_Currency,
mp_emailsendlog to mp_EmailSendLog,
mp_emailsendqueue to mp_EmailSendQueue,
mp_emailtemplate to mp_EmailTemplate,
mp_fileattachment to mp_FileAttachment,
mp_forumposts to mp_ForumPosts,
mp_forums to mp_Forums,
mp_forumsubscriptions to mp_ForumSubscriptions,
mp_forumthreads to mp_ForumThreads,
mp_forumthreadsubscriptions to mp_ForumThreadSubscriptions,
mp_friendlyurls to mp_FriendlyUrls,
mp_galleryimages to mp_GalleryImages,
mp_geocountry to mp_GeoCountry,
mp_geozone to mp_GeoZone,
mp_googlecheckoutlog to mp_GoogleCheckoutLog,
mp_htmlcontent to mp_HtmlContent,
mp_indexingqueue to mp_IndexingQueue,
mp_language to mp_Language,
mp_letter to mp_Letter,
mp_letterhtmltemplate to mp_LetterHtmlTemplate,
mp_letterinfo to mp_LetterInfo,
mp_lettersendlog to mp_LetterSendLog,
mp_lettersubscribe to mp_LetterSubscribe ,
mp_lettersubscribehx to mp_LetterSubscribeHx,
mp_links to mp_Links,
mp_mediafile to mp_MediaFile,
mp_mediaplayer to mp_MediaPlayer,
mp_mediatrack to mp_MediaTrack,
mp_moduledefinitions to mp_ModuleDefinitions,
mp_moduledefinitionsettings to mp_ModuleDefinitionSettings,
mp_modules to mp_Modules,
mp_modulesettings to mp_ModuleSettings,
mp_pagemodules to mp_PageModules,
mp_pages to mp_Pages,
mp_paymentlog to mp_PaymentLog,
mp_paypallog to mp_PayPalLog,
mp_plugnpaylog to mp_PlugNPayLog,
mp_pollmodules to mp_PollModules,
mp_polloptions to mp_PollOptions,
mp_polls to mp_Polls,
mp_pollusers to mp_PollUsers,
mp_redirectlist to mp_RedirectList,
mp_roles to mp_Roles,
mp_rssfeedentries to mp_RssFeedEntries,
mp_rssfeeds to mp_RssFeeds,
mp_savedquery to mp_SavedQuery,
mp_schemascripthistory to mp_SchemaScriptHistory,
mp_schemaversion to mp_SchemaVersion,
mp_sharedfilefolders to mp_SharedFileFolders,
mp_sharedfiles to mp_SharedFiles,
mp_sharedfileshistory to mp_SharedFilesHistory,
mp_sitefolders to mp_SiteFolders,
mp_sitehosts to mp_SiteHosts,
mp_sitemoduledefinitions to mp_SiteModuleDefinitions,
mp_sitepaths to mp_SitePaths,
mp_sitepersonalizationallusers to mp_SitePersonalizationAllUsers,
mp_sitepersonalizationperuser to mp_SitePersonalizationPerUser,
mp_sites to mp_Sites,
mp_sitesettingsex to mp_SiteSettingsEx,
mp_sitesettingsexdef to mp_SiteSettingsExDef,
mp_surveymodules to mp_SurveyModules,
mp_surveypages to mp_SurveyPages,
mp_surveyquestionanswers to mp_SurveyQuestionAnswers,
mp_surveyquestionoptions to mp_SurveyQuestionOptions,
mp_surveyquestions to mp_SurveyQuestions,
mp_surveyresponses to mp_SurveyResponses,
mp_surveys to mp_Surveys,
mp_systemlog to mp_SystemLog,
mp_tag to mp_Tag,
mp_tagitem to mp_TagItem,
mp_tagvocabulary to mp_TagVocabulary,
mp_taskqueue to mp_TaskQueue,
mp_taxclass to mp_TaxClass,
mp_taxrate to mp_TaxRate,
mp_taxratehistory to mp_TaxRateHistory,
mp_userlocation to mp_UserLocation,
mp_userpages to mp_UserPages,
mp_userproperties to mp_UserProperties,
mp_userroles to mp_UserRoles,
mp_users to mp_Users,
mp_webparts to mp_WebParts,
ws_cart to ws_Cart,
ws_cartoffers to ws_CartOffers,
ws_cartorderinfo to ws_CartOrderInfo,
ws_discount to ws_Discount,
ws_fullfilldownloadhistory to ws_FullfillDownloadHistory,
ws_fullfilldownloadterms to ws_FullfillDownloadTerms,
ws_fullfilldownloadticket to ws_FullfillDownloadTicket,
ws_offer to ws_Offer,
ws_offeravailability to ws_OfferAvailability,
ws_offeravailabilityhistory to ws_OfferAvailabilityHistory,
ws_offerhistory to ws_OfferHistory,
ws_offerpricehistory to ws_OfferPriceHistory,
ws_offerproduct to ws_OfferProduct,
ws_order to ws_Order,
ws_orderofferproduct to ws_OrderOfferProduct,
ws_orderoffers to ws_OrderOffers,
ws_orderstatus to ws_OrderStatus,
ws_orderstatusdescription to ws_OrderStatusDescription,
ws_product to ws_Product ,
ws_productfile to ws_ProductFile,
ws_producthistory to ws_ProductHistory,
ws_store to ws_Store,
ws_storecurrency to ws_StoreCurrency,
ws_storelanguage to ws_StoreLanguage;

 

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