DotNetNuke 4.3.x Users who have upgraded their sites from version 4.0.x are experiencing issues with creating new Portals.
During development of the new features in DotNetNuke 3.3/4.3, most of the devlopment work was carried out in the 3.x code-base and then copied (and where neccessary modified) to the 4.x code-base. This includes the scripts needs to upgrade the database.
One particular script, however, was not synchronised correctly (3.2.6 -> 4.0.6). The 4.0.6 script is empty, so the script changes that the 3.2.6 script applies are not duplicated in the 4.0.6 version.
This script updates 3 stored procedures - the one that appears to be causing all the issues is the update to AddPortalInfo. The other 2 stored procedures are not affected, as there are later scripts in both codebases that update them again.
Therefore - users who upgrade from 4.0.x to 4.3.x have a bad AddPortalInfo script. This will be fixed in the next maintenance release, but users who wish to "fix" their sites now, can apply the following procedure to update their database.
Procedure to fix existing sites:- Find the 3.2.6.SqlDataProvider script file.
- Copy the first part of the script (that updates AddPortalInfo). For convenience I will paste the script at the end of this blog
- Go to the Host menu in your site, select the SQL tab.
- Paste the script in the window, make sure the "Run as Script" check box is selected and click "Execute".
As long as everything worked - the screen will refresh displaying no red messages. Your database should now be updated and you should be able create a new portal.
Script to use to upgrade the database.if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}AddPortalInfo]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE {databaseOwner}[{objectQualifier}AddPortalInfo]
GO
CREATE PROCEDURE {databaseOwner}[{objectQualifier}AddPortalInfo]
@PortalName nvarchar(128),
@Currency char(3),
@ExpiryDate datetime,
@HostFee money,
@HostSpace int,
@SiteLogHistory int,
@HomeDirectory varchar(100)
as
DECLARE @PortalID int
insert into {objectQualifier}Portals (
PortalName,
ExpiryDate,
UserRegistration,
BannerAdvertising,
Currency,
HostFee,
HostSpace,
Description,
KeyWords,
SiteLogHistory,
HomeDirectory
)
values (
@PortalName,
@ExpiryDate,
0,
0,
@Currency,
@HostFee,
@HostSpace,
@PortalName,
@PortalName,
@SiteLogHistory,
@HomeDirectory
)
SET @PortalID = SCOPE_IDENTITY()
IF @HomeDirectory = ''
BEGIN
UPDATE {objectQualifier}Portals SET HomeDirectory = 'Portals/' + convert(varchar(10), @PortalID) WHERE PortalID = @PortalID
END
SELECT @PortalID
GO