Importing mojoportal 1.x site data into 2.x install

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
1/19/2009 5:26:12 PM
Gravatar
Total Posts 18439

Re: Importing mojoportal 1.x site data into 2.x install

Hi Rene,

I know there was a time when things got funky with primary key names. The history is that originally we had just unique constraints and though they were functionally equivalent to primary keys, they had the disadvantage of not being found by getting the primary key list for a table, so there were some scripts to change it and add primary keys. The error sounds like the table already has one and the script is trying to add another one and its probably true. Any errors you get like this I would just find it in the script where its creating a new primary key and chop it out and try to keep going by visit the Setup page again.

Hope it helps,

Joe

1/19/2009 6:01:27 PM
Gravatar
Total Posts 29

Re: Importing mojoportal 1.x site data into 2.x install

Hi Joe,

I managed to do that - edit the DB update script for 2.2.3.9, but now it's stuck at 2.2.4.9:

Probing system...
File system permissions ok.
pgsql database connection ok.
database permissions are sufficient to alter schema.
database initial schema already exists.
database core schema needs upgrade.
2 site(s) found.
Running script mojoportal-core - 2.2.4.9 - 00:00:00.3080820
Npgsql.NpgsqlException: cannot drop index mp_blogcategories_pkey because constraint mp_blogcategories_pkey on table mp_blogcategories requires it Severity: ERROR Code: 2BP01 Hint: You may drop constraint mp_blogcategories_pkey on table mp_blogcategories instead. at Npgsql.NpgsqlState+ c__Iterator1.MoveNext () [0x00000] at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject () [0x00000] - 00:00:00.4155170
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.

It's really getting quite late and I fear I have to abandon my update attempts for today (1:00 right now...). Hopefully I'll find some time to continue with this tomorrow, and I really hope I haven't gotten the database schema into an inconsistent state now.

best regards,

Rene

1/19/2009 6:06:09 PM
Gravatar
Total Posts 18439

Re: Importing mojoportal 1.x site data into 2.x install

Same thing, just find where its trying to drop that index, chop it out and keep going.

Hope it helps,

Joe

1/20/2009 5:44:26 AM
Gravatar
Total Posts 29

Re: Importing mojoportal 1.x site data into 2.x install

Hi Joe,

This was quite a painful (read: slow and requiring many manual steps) procedure, but I got the mojoportal-core scripts to run correctly until 2.2.8.2. I had to manually remove a lot of primary key constraints and modify the script for 2.2.4.9 to re-create them afterwards.

Now I am a few steps further, but still get an error:

Probing system...
File system permissions ok.
pgsql database connection ok.
database permissions are sufficient to alter schema.
database initial schema already exists.
database core schema needs upgrade.
2 site(s) found.
Running script mojoportal-core - 2.2.4.9 - 00:00:00.4009960
Running script mojoportal-core - 2.2.5.0 - 00:00:01.1466580
Running script mojoportal-core - 2.2.5.1 - 00:00:04.7723730
Running script mojoportal-core - 2.2.5.2 - 00:00:04.8713700
Running script mojoportal-core - 2.2.5.3 - 00:00:07.2356050
Running script mojoportal-core - 2.2.5.4 - 00:00:08.4920910
Running script mojoportal-core - 2.2.5.5 - 00:00:09.8359720
Running script mojoportal-core - 2.2.5.6 - 00:00:12.6329480
Running script mojoportal-core - 2.2.5.7 - 00:00:13.9040420
Running script mojoportal-core - 2.2.5.8 - 00:00:15.0594130
Running script mojoportal-core - 2.2.5.9 - 00:00:16.4074190
Running script mojoportal-core - 2.2.6.0 - 00:00:16.5189500
Running script mojoportal-core - 2.2.6.1 - 00:00:20.3936080
Running script mojoportal-core - 2.2.6.2 - 00:00:20.5261570
Running script mojoportal-core - 2.2.6.3 - 00:00:22.3825670
Running script mojoportal-core - 2.2.6.4 - 00:00:22.7107740
Running script mojoportal-core - 2.2.6.5 - 00:00:22.8580380
Running script mojoportal-core - 2.2.6.6 - 00:00:22.9767720
Running script mojoportal-core - 2.2.6.7 - 00:00:24.4593380
Running script mojoportal-core - 2.2.6.8 - 00:00:24.5936010
Running script mojoportal-core - 2.2.6.9 - 00:00:26.1721010
Running script mojoportal-core - 2.2.7.0 - 00:00:27.7825130
Running script mojoportal-core - 2.2.7.1 - 00:00:27.8876580
Running script mojoportal-core - 2.2.7.2 - 00:00:27.9988110
Running script mojoportal-core - 2.2.7.3 - 00:00:29.7991060
Running script mojoportal-core - 2.2.7.4 - 00:00:29.9293260
Running script mojoportal-core - 2.2.7.5 - 00:00:30.1820650
Running script mojoportal-core - 2.2.7.6 - 00:00:30.4810860
Running script mojoportal-core - 2.2.7.7 - 00:00:30.6187960
Running script mojoportal-core - 2.2.7.8 - 00:00:30.7450790
Running script mojoportal-core - 2.2.7.9 - 00:00:30.8888050
Running script mojoportal-core - 2.2.8.0 - 00:00:31.0071120
Running script mojoportal-core - 2.2.8.1 - 00:00:31.1368760
Running script mojoportal-core - 2.2.8.2 - 00:00:31.2381100
Configuring feature HTML-Inhalt - 00:00:32.0641690
Configuring feature Seitenstatistik - 00:00:32.3352450
Running script blog - 0.0.0.2 - 00:00:32.9648140
Running script blog - 0.0.0.3 - 00:00:33.0785960
Running script blog - 0.0.0.4 - 00:00:33.3083370
Running script blog - 0.0.0.5 - 00:00:33.4297660
Running script blog - 0.0.0.6 - 00:00:33.5704960
Configuring feature Blog - 00:00:33.7517360
Running script contactform - 0.0.0.2 - 00:00:36.5516310
Configuring feature Kontaktformular - 00:00:36.7772020
Running script eventcalendar - 0.0.0.2 - 00:00:37.2881790
Configuring feature Kalender - 00:00:37.4767400
Running script feed-manager - 0.0.0.2 - 00:00:38.2961040
Running script feed-manager - 0.0.0.3 - 00:00:38.4033130
Configuring feature Feed Manager - 00:00:38.5425010
Configuring feature Image Gallery (Simple Folder Version) - 00:00:39.5060260
Running script forums - 0.0.0.2 - 00:00:39.8258720
Configuring feature Foren - 00:00:39.9674630
Configuring feature Google Map - 00:00:40.4739340
Configuring feature Html Fragment include - 00:00:41.2375450
Running script imagegallery - 0.0.0.2 - 00:00:41.6627000
Configuring feature Bildgalerie - 00:00:41.8037580
Running script linksmodule - 0.0.0.2 - 00:00:42.3049490
Configuring feature Link-Tabelle - 00:00:42.4345950
Running script pollfeature-byChristianFredh - 0.0.0.2 - 00:00:42.7344840
Running script pollfeature-byChristianFredh - 0.0.0.3 - 00:00:43.4287700
Configuring feature Poll - 00:00:43.6808100
Running script sharedfiles - 0.0.0.2 - 00:00:44.2622060
Configuring feature Gemeinsam benutzte Dateien - 00:00:44.5330390
Running script surveyfeature - 0.0.1.2 - 00:00:44.7697840
Running script surveyfeature - 0.0.1.3 - 00:00:45.7508480
Configuring feature Survey - 00:00:45.9729970
Configuring feature Xml/Xsl - 00:00:46.4183220
Ensuring all features are installed in server admin sites... - 00:00:46.6100130

An Error Occurred:ERROR: 23502: null value in column "sortorder" violates not-null constraint
Source:Npgsql
Stack Trace at Npgsql.NpgsqlState+ c__Iterator1.MoveNext () [0x00000] at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject () [0x00000]
 
Unfortunately, it doesn't say which table that is... Do you have any idea on that one?
best regards,
Rene

1/20/2009 5:59:29 AM
Gravatar
Total Posts 29

Re: Importing mojoportal 1.x site data into 2.x install

Hi Joe,

Addendum: if that table is mp_moduledefinitions, then I can't find that null value:

mojoportal=# select featurename,sortorder from mp_moduledefinitions;
          featurename           | sortorder
--------------------------------+-----------
 Html Snippet Include           |       500
 Feature Modules (Admin)        |       502
 Roles (Admin)                  |       505
 Pages                          |       500
 Site Settings (Admin)          |       501
 File Manager (Admin)           |       580
 Friendly Url Manager           |       700
 Url Manager (Admin)            |       700
 HtmlContentFeatureName         |       300
 SiteStatisticsFeatureName      |       500
 BlogFeatureName                |       500
 ContactFormFeatureName         |       500
 EventCalendarFeatureName       |       500
 FeatureName                    |       500
 FolderGalleryFeatureName       |       500
 ForumsFeatureName              |       500
 GoogleMapFeatureName           |       500
 HtmlFragmentIncludeFeatureName |       500
 ImageGalleryFeatureName        |       500
 LinksFeatureName               |       500
 PollFeatureName                |       500
 SharedFilesFeatureName         |       500
 SurveyFeatureName              |       500
 XmlXslFeatureName              |       500
(24 rows)
 

The same is true for mp_moduledefinitionsettings, mp_sitesettingsexdef, and mp_htmlcontent (other tables in which I could find a "sortorder" column). Any hints?

best regards,

Rene

1/20/2009 6:02:53 AM
Gravatar
Total Posts 18439

Re: Importing mojoportal 1.x site data into 2.x install

Hi Rene,

I think this error is not crucial, its happening in the place where its just checking if all the features are installed. The site may work if you visit the root.

I would look in the mp_ModuleDefinitions table, if any rows are null in SortOrder give them a value.

I would check to make sure there are no orphan rows in mp_modulesettings

In general Guid columns have been added to most tables as alternate primary keys. It was tricky with pgsql because there is no native guid, so we generate them in .net and pass them in as char 36. I would look for any tables where the guids did not get populated. Let me know which tables if any are found not to have the guids.

Hope it helps,

Joe

1/20/2009 6:25:38 AM
Gravatar
Total Posts 29

Re: Importing mojoportal 1.x site data into 2.x install

Hi Joe,

He, you're already up :)

To answer your questions:

1. mp_moduledefinitions seems to be ok:

mojoportal=# select * from mp_moduledefinitions where sortorder < 300 or guid is null;
 moduledefid | featurename | controlsrc | sortorder | isadmin | icon | defaultcachetime |guid | resourcefile
-------------+-------------+------------+-----------+---------+------+------------------+------+--------------
(0 rows)
 

2. I'm not sure what you mean by orphan rows in mp_modulesettings. Its current definition is

mojoportal=# \d mp_modulesettings
                                               Table "public.mp_modulesettings"
          Column           |          Type          |                                Modifiers
---------------------------+------------------------+--------------------------------------------------------------------------
 id                        | integer                | not null default nextval(('"mp_modulesettings_id_seq"'::text)::regclass)
 moduleid                  | integer                | not null
 settingname               | character varying(50)  | not null
 settingvalue              | character varying(255) | not null
 controltype               | character varying(50)  |
 regexvalidationexpression | text                   |
 moduleguid                | character varying(36)  |
 settingguid               | character varying(36)  |
 controlsrc                | character varying(255) |
 helpkey                   | character varying(255) |
 sortorder                 | integer                | not null default 100
Indexes:
    "pk_modulesettings" PRIMARY KEY, btree (id)
    "ifk_modulesettings_moduleid" btree (moduleid)
    "mp_modulesettings_ix_modul-0" btree (moduleid, settingname)
Foreign-key constraints:
    "fk_modulesettings_modules" FOREIGN KEY (moduleid) REFERENCES mp_modules(moduleid)
    "fk_modulesettings_modules_fk" FOREIGN KEY (moduleid) REFERENCES mp_modules(moduleid)

and it doesn't seem to contain any non-default entries in sortorder:

mojoportal=# select * from mp_modulesettings where sortorder != 100;
 id | moduleid | settingname | settingvalue | controltype | regexvalidationexpression | moduleguid | settingguid | controlsrc | helpkey | sortorder
----+----------+-------------+--------------+-------------+---------------------------+------------+-------------+------------+---------+-----------
(0 rows)
 

3. Concerning guid columns: There are many of them, and it would take quite some time to check them all. Would it be necessary to check all columns with "guid" in the name or only those that are named exactly "guid" (I assume the former are generally foreign keys and should therefore be filled no matter what)?

 

The root page of the site does indeed start, but with two major problems right now (without checking any of the details):

4. Skinning seems broken. Although I managed to (using Tab a lot ;) ) change from the default skin to one that would not overlay the whole page with my menu und sub-menu entries (I currently selected jsavard-subblue, which is still broken in terms of the menu layout, but at least restricted to the top part), only the menu seems to change with it. That is, the other elements (general page layout, header image, colors, etc.) seem to remain fixed to the styleshout-techmania style (or something else that looks like the mojoportal 2 default). Is there any database setting that needs to be overwritten to make it work again?

5. I have the same problem as on my eariler try of converting to mojoportal 2: All static HTML content blocks are shown in "encoded" (i.e. HTML) form. I assume the reason is that in my mojoportal 1 database, all HTML content is stored in an escaped form, and thus doesn't get interpreted. What is the best way to change the encoding to the way mojoportal 2 handles it now?

best regards,

Rene

1/20/2009 6:43:17 AM
Gravatar
Total Posts 18439

Re: Importing mojoportal 1.x site data into 2.x install

Hi Rene,

DB stuff

Delete from mp_modulesettings where moduleid NOT IN (SELECT moduleid from mp_modules);

Delete from mp_modulesettings where moduleid  IN (SELECT moduleid from mp_modules WHERE moduledefid NOT IN (SELECT moduledefid FROM mp_moduledefinitions));

Hopefully there are no orphans but that will get rid of them if there are.

Don't worry about guid columns for now they are probably/hopefully ok.

Skins

I would copy the content from /Data/skins into /Data/Sites/[SiteID]/skins for both of your sites.

If css problem continues, view the source of the page and get the full url for the css ...csshandler.ashx?... and paste it into the browser and see if you get css or an error. If an error, you may be able to workaround by setting <add key="CombineCSS" value="false"/> in Web.config.

Encoding Problem

I forgot about this but, back in the day we were encoding the content going into the db and decoding it on the way out which was a mistaken design. So now we do not encode it and we do not decode it so any content that is already in there encoded needs to be decoded in the db. There is a utility page to assist with this. If you log in as admin and navigate to /Admin/dbUtils.aspx you will see it.

Hope it helps,

Joe

 

 

1/20/2009 7:20:15 AM
Gravatar
Total Posts 29

Re: Importing mojoportal 1.x site data into 2.x install

Hi Joe,

I'm still impressed by your speed on following up forum posts...

DB stuff

mojoportal=# Delete from mp_modulesettings where moduleid NOT IN (SELECT moduleid from mp_modules);
DELETE 0
mojoportal=# Delete from mp_modulesettings where moduleid  IN (SELECT moduleid from mp_modules WHERE moduledefid NOT IN (SELECT moduledefid FROM mp_moduledefinitions));
DELETE 0
So, seemingly no orphans -good.

Having been programming for too long now, failing consistency checks definitely make me worry, though ;) I assume the

Ensuring all features are installed in server admin sites... - 00:00:09.9047010

An Error Occurred:ERROR: 23502: null value in column "sortorder" violates not-null constraint
is generated by .Net code (and not DB stored procedures). Would it be clear in the code which tables might cause this error during this particular check?
Skins
I double-checked, and, as usual, /Data/skins and /Data/Sites/1/skins are equal:
rene@voyager:/srv/www/mojoportal/Data$ diff -rq skins/ Sites/1/skins/
rene@voyager:/srv/www/mojoportal/Data$ echo $?
0
On my in-production sites, I actually link most of the directories from Sites/x/y directly to ../../y. This has worked in the past, and now I did it for the test site as well. Thus, the skins should be properly installed. I will need to check the CSS and if the browser can reach it, but I don't think that this is the problem. When using the "empty" default database, skinning works. When using my converted one with content, it doesn't. (I can switch back and forth between the two dumps.)
Encoding
I used this tool to fix the encoding - thanks for the hint! With this issue fixed, the updated page is now slowly taking its shape (although I will need to adapt my layout).
 
best regards,
Rene

1/20/2009 8:06:20 AM
Gravatar
Total Posts 18439

Re: Importing mojoportal 1.x site data into 2.x install

Hi Rene,

Try

Delete from mp_modulesettings WHERE controltype IS NULL;

The reason to test the css url in the browser is its a handler, it no longer adds just urls to static css files, it executes .NET code to combine and minify css files. Maybe it can't do it with your linked folders or maybe there is a Mono error happening. See Important Skin Changes for more info.

Hope it helps,

Joe

1/20/2009 8:15:36 AM
Gravatar
Total Posts 29

Re: Importing mojoportal 1.x site data into 2.x install

Hi Joe,

Deleting these lines from mp_modulesettings did the trick, the Setup page now ran through successfully. Thanks for helping me debug it this far! Your excellent support is one of the reasons why I like mojoportal so much.

 

Concerning skinning, it seems that only part of the skin is applied: When I change the skin and then look at the page source, I see that the style files seem to be selected correctly, e.g.

link href='http://localhost/Data/Sites/1/skins/extjs-viewport1/style.css' type='text/css' rel='stylesheet' />
<link href='http://localhost/Data/Sites/1/skins/extjs-viewport1/styletext.css' type='text/css' rel='stylesheet' title='Normaltext' />
<link href='http://localhost/Data/Sites/1/skins/extjs-viewport1/styleprinter.css' type='text/css' rel='stylesheet' media='print' />
<link href='http://localhost/Data/Sites/1/skins/extjs-viewport1/stylemenu.css' type='text/css' rel='stylesheet' media='screen' />
<link href='http://localhost/Data/Sites/1/skins/extjs-viewport1/styletreeview.css' type='text/css' rel='stylesheet' media='screen' />
or


<link href='http://localhost/Data/Sites/1/skins/extjs-viewport1/styletreeview.css' type='text/css' rel='stylesheet' media='screen' />

This also shows in the way the top menu is painted. Although still horribly broken, I see that it changes depending on the selected skin. On the other hand, the whole page "master" layout does not change, as evident e.g. in the footer part:

        <a title="Visit the web site of the designer" href="http://www.styleshout.com/">Design by styleshout</a>

The weird thing is that with the same installation on fht filesystem, skins work with the empty default database, just not with the converted one. So it's (IMHO) unlikely to be a filesystem (permissions, links, whatever) reason.

best regards,

Rene

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