Index: branches/RC/core/install/upgrades.sql
===================================================================
diff -u -N -r11600 -r11610
--- branches/RC/core/install/upgrades.sql	(.../upgrades.sql)	(revision 11600)
+++ branches/RC/core/install/upgrades.sql	(.../upgrades.sql)	(revision 11610)
@@ -1024,7 +1024,7 @@
 ALTER TABLE Category
 	ADD ThemeId INT UNSIGNED NOT NULL,
 	ADD INDEX (ThemeId),
-	ADD COLUMN UseExternalUrl tinyint(3) unsigned NOT NULL default '0' AFTER Path,
+	ADD COLUMN UseExternalUrl tinyint(3) unsigned NOT NULL default '0' AFTER Template,
 	ADD COLUMN ExternalUrl varchar(255) NOT NULL default '' AFTER UseExternalUrl,
 	ADD COLUMN UseMenuIconUrl tinyint(3) unsigned NOT NULL default '0' AFTER ExternalUrl,
 	ADD COLUMN MenuIconUrl varchar(255) NOT NULL default '' AFTER UseMenuIconUrl,
@@ -1038,8 +1038,9 @@
 UPDATE Category SET l3_MenuTitle = l3_Name WHERE l3_MenuTitle = '' OR l3_MenuTitle LIKE '_Auto: %';
 UPDATE Category SET l4_MenuTitle = l4_Name WHERE l4_MenuTitle = '' OR l4_MenuTitle LIKE '_Auto: %';
 UPDATE Category SET l5_MenuTitle = l5_Name WHERE l5_MenuTitle = '' OR l5_MenuTitle LIKE '_Auto: %';
-UPDATE Category SET Template = '/platform/designs/default_design.des' WHERE Template = '/in-edit/designs/general';
-UPDATE Category SET CachedTemplate = '/platform/designs/default_design.des' WHERE CachedTemplate = '/in-edit/designs/general';
+UPDATE Category SET Template = '/platform/designs/general' WHERE Template = '/in-edit/designs/general';
+UPDATE Category SET CachedTemplate = '/platform/designs/general' WHERE CachedTemplate = '/in-edit/designs/general';
+UPDATE Category SET CachedTemplate = Template WHERE Template <> '';
 
 CREATE TABLE PageContent (
   PageContentId int(11) NOT NULL auto_increment,
@@ -1109,6 +1110,28 @@
 UPDATE ConfigurationAdmin SET DisplayOrder = 10.29 WHERE VariableName = 'cms_DefaultDesign';
 
 UPDATE Phrase SET Module = 'Core' WHERE Phrase IN ('la_Hide', 'la_Show', 'la_fld_Requied', 'la_col_Modified');
+UPDATE Phrase SET Phrase = 'la_title_Editing_E-mail' WHERE Phrase = 'la_title_editing_e-mail';
+
 ALTER TABLE Phrase ADD UNIQUE (LanguageId, Phrase);
 
-ALTER TABLE CustomField ADD IsRequired TINYINT( 3 ) UNSIGNED;
+ALTER TABLE CustomField ADD IsRequired TINYINT(3) UNSIGNED;
+
+DELETE FROM Permissions WHERE Permission LIKE 'proj-cms:structure%';
+UPDATE Permissions SET Permission = REPLACE(Permission, 'proj-cms:browse', 'in-portal:browse_site');
+UPDATE Permissions SET Permission = REPLACE(Permission, 'proj-cms:', 'in-portal:');
+
+ALTER TABLE CategoryItems ADD INDEX (ItemResourceId);
+ALTER TABLE CategoryItems
+	DROP INDEX Filename,
+	ADD INDEX Filename(Filename);
+
+DROP TABLE Pages;
+DELETE FROM PermissionConfig WHERE PermissionName LIKE 'PAGE.%';
+DELETE FROM Permissions WHERE Permission LIKE 'PAGE.%';
+DELETE FROM SearchConfig WHERE TableName = 'Pages';
+DELETE FROM ConfigurationAdmin WHERE VariableName LIKE '%_pages';
+DELETE FROM ConfigurationValues WHERE VariableName LIKE '%_pages';
+DELETE FROM ConfigurationAdmin WHERE VariableName LIKE 'PerPage_Pages%';
+DELETE FROM ConfigurationValues WHERE VariableName LIKE 'PerPage_Pages%';
+
+UPDATE Modules SET Version = '5.0.0' WHERE Name = 'In-Portal';
