Problem upgrading to new version. Index was outside the bounds of the array.

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.
2/24/2015 1:27:41 AM
Gravatar
Total Posts 18

Re: Problem upgrading to new version. Index was outside the bounds of the array.

Currently original site is working. I did create backup and restore backup to new database, not copy tables. Then I did unpackage CMS to my home server and connect it to that restored database. As I did write before, setup did run through and problem is just with skins - I did get data from database and pictures from site.

I will look at link, that you did post, so, that I will see if I did miss something.

Alternative would be - is there any option to export data and import it into new installation?

2/24/2015 7:05:33 AM
Gravatar
Total Posts 18439

Re: Problem upgrading to new version. Index was outside the bounds of the array.

"I did create backup and restore backup to new database, not copy tables."

With all due respect the evidence suggests that is not true, if it were true you would not have lost all the identity specifications, default values, and other properties on the tables as you have.

"is there any option to export data and import it into new installation?"

No, that is what you already tried, it leads only to countless errors. Banish the notion of import/export from your thoughts, it is not a solution, it is the cause of this problem and more problems to come if you keep going.

The only options are use mssql management tools to create a backup and then to restore a backup, or use a 3rd party tool that is capable of scripting the objects correctly and the data. Tools such as RedGate can do that, but there is also a free tool linked in our article about using MS SQL, see the section "Moving From One Server To Another" in the MSSQL documentation.

2/24/2015 7:20:28 AM
Gravatar
Total Posts 18

Re: Problem upgrading to new version. Index was outside the bounds of the array.

As I did write. When I did try to upgrade I did backup database and restore it in the same server under different database name. Then I did run setup to upgrade. I did not do any export / import operations. Currently old version is operational.

Upgrade procedure that I did was:

1. Backup database

2. restore database as new database

3. on different machine I did extract mojoPortal, setup ASP.NET application, change folder permissions for data and App_Data, connect to new database

4. run /setup

Currently state is - i see web site with data, that is on production site, but there is no CSS (skins)

2/24/2015 7:27:02 AM
Gravatar
Total Posts 18439

Re: Problem upgrading to new version. Index was outside the bounds of the array.

you need to use web browser dev tools to see if it is failing to load the css or if an error is happening in the csshandler

ie view source to see the url of the css, follow the url, does it produce css or an error, is it pointing correctly to a skin name that exists, etc

use browser dev tools network tab and console to look for script errors and/or files that failed to load

 

2/24/2015 7:36:32 AM
Gravatar
Total Posts 18

Re: Problem upgrading to new version. Index was outside the bounds of the array.

I will check that later, when I get home. For now (I did check that yesterday):

I did look at network traffic, and I did not see any requests, that did not get response. If I remember correctly, there was only 1 request to for css files, all other were for scripts, content, pictures.

I did also inspect content. I did see classes on divs, but with no definitions for classes (I did use Firebug). It was as theme was not applied on site.

2/24/2015 1:04:11 PM
Gravatar
Total Posts 18

Re: Problem upgrading to new version. Index was outside the bounds of the array.

When I did examine the network traffic I did noticed, that CSS was 0 bytes long.

It was my mistake - I did forget to copy additional skin. Now it works.

I do have 1 more problem, but it was present also before. If I click on edit this page i get:

AuthorizedRoles

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IndexOutOfRangeException: AuthorizedRoles

Source Error:
 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:
[IndexOutOfRangeException: AuthorizedRoles] System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) +6277726 System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) +249 System.Data.SqlClient.SqlDataReader.get_Item(String name) +23 mojoPortal.Web.AdminUI.PageLayout.BindFeatureList() +100 mojoPortal.Web.AdminUI.PageLayout.PopulateControls() +206 System.Web.UI.Control.OnLoad(EventArgs e) +132 mojoPortal.Web.mojoBasePage.OnLoad(EventArgs e) +21 System.Web.UI.Control.LoadRecursive() +66 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

Do you have any idea what could be the problem?

2/24/2015 1:09:45 PM
Gravatar
Total Posts 18439

Re: Problem upgrading to new version. Index was outside the bounds of the array.

ALTER PROCEDURE [dbo].[mp_ModuleDefinitions_SelectUserModules]

    
@SiteID  int


AS

SELECT           md.*,
smd.AuthorizedRoles

FROM            mp_ModuleDefinitions md

JOIN            mp_SiteModuleDefinitions smd
ON            smd.ModuleDefID = md.ModuleDefID
    
WHERE           smd.SiteID = @SiteID
            AND md.IsAdmin = 0

ORDER BY         md.SortOrder, md.FeatureName


GO

2/24/2015 4:16:06 PM
Gravatar
Total Posts 18

Re: Problem upgrading to new version. Index was outside the bounds of the array.

You were right - it seems, that around 2 years ago, when I was forced to move to different server, database transfer was not done as backup restore - because of incompatibility of servers.

I did create empty installation and then use SQLDBDIFF and find differences between my database and fresh empty one. I did sync differences and now it all works.

The whole upgrade was because of Medium trust. I did see post:

https://www.mojoportal.com/mediumtrust.aspx

But I do not find file Web.mediumtrust.config

I get same error as

https://www.mojoportal.com/Forums/Thread.aspx?pageid=5&t=1778~1

Cannot subset Regex. Only support if both patterns are identical.

Just for refresh - I use: 2.4.0.3 MSSQL

 

2/25/2015 11:47:27 AM
Gravatar
Total Posts 18439

Re: Problem upgrading to new version. Index was outside the bounds of the array.

if you have a new question please start a new thread and explain it clearly in terms of steps to produce the error and the stack trace of the error

2/25/2015 1:08:52 PM
Gravatar
Total Posts 18

Re: Problem upgrading to new version. Index was outside the bounds of the array.

Okay.  Thanks.  I will open new thread at the end of week, when I return.

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