Developer forum

Forum » Development » Moving a website to AreaID 1

Moving a website to AreaID 1

Martin Nielsen
Reply

Hi DW,

I have a website that has a website running on AreaID 4, and i'd like to move it to AreaID 1, since i don't have a website on that area, and Dynamicweb works best of our website is in AreaID 1.

I've created this small SQL script that moves and changes an areas ID in the database.

I'd like to if there are any issue i should be aware of before doing this.

 

DECLARE @SourceAreaID int;
DECLARE @DestinationAreaID int;

SET @SourceAreaID = 4
SET @DestinationAreaID = 1

DELETE FROM Area WHERE AreaID = @DestinationAreaID

SET IDENTITY_INSERT Area ON
INSERT INTO Area ([AreaID]
,[AreaStyleID]
,[AreaName]
,[AreaDomain]
,[AreaEncoding]
,[AreaPermission]
,[AreaPermissionTemplate]
,[AreaTitle]
,[AreaKeywords]
,[AreaDescription]
,[AreaFrontpage]
,[AreaDateformat]
,[AreaCodepage]
,[AreaLanguage]
,[StyleID]
,[AreaMasterTemplate]
,[AreaHtmlType]
,[AreaCulture]
,[AreaApprovalType]
,[AreaEcomLanguageID]
,[AreaEcomCurrencyID]
,[AreaActive]
,[AreaSort]
,[AreaMasterAreaID]
,[AreaLanguageControlLanguage]
,[AreaRobotsTxt]
,[AreaRobotsTxtIncludeSitemap]
,[AreaDomainLock]
,[AreaUserManagementPermissions]
,[AreaUrlName]
,[AreaUpdatedDate]
,[AreaCreatedDate]
,[AreaCopyOf]
,[AreaLayout]
,[AreaNotFound]
,[AreaRedirectFirstPage]
,[AreaLayoutPhone]
,[AreaLayoutTablet]
,[AreaLockPagesToDomain]
,[AreaEcomCountryCode]
,[AreaEcomShopID]
,[AreaUrlIgnoreForChildren]
,[AreaItemType]
,[AreaItemId]
,[AreaCookieWarningTemplate]
,[AreaCookieCustomNotifications]
,[AreaItemTypePageProperty]
,[AreaIncludeProductsInSitemap]
,[AreaSSLMode]
,[AreaEcomPricesWithVat]) 
SELECT @DestinationAreaID
,[AreaStyleID]
,[AreaName]
,[AreaDomain]
,[AreaEncoding]
,[AreaPermission]
,[AreaPermissionTemplate]
,[AreaTitle]
,[AreaKeywords]
,[AreaDescription]
,[AreaFrontpage]
,[AreaDateformat]
,[AreaCodepage]
,[AreaLanguage]
,[StyleID]
,[AreaMasterTemplate]
,[AreaHtmlType]
,[AreaCulture]
,[AreaApprovalType]
,[AreaEcomLanguageID]
,[AreaEcomCurrencyID]
,[AreaActive]
,[AreaSort]
,[AreaMasterAreaID]
,[AreaLanguageControlLanguage]
,[AreaRobotsTxt]
,[AreaRobotsTxtIncludeSitemap]
,[AreaDomainLock]
,[AreaUserManagementPermissions]
,[AreaUrlName]
,[AreaUpdatedDate]
,[AreaCreatedDate]
,[AreaCopyOf]
,[AreaLayout]
,[AreaNotFound]
,[AreaRedirectFirstPage]
,[AreaLayoutPhone]
,[AreaLayoutTablet]
,[AreaLockPagesToDomain]
,[AreaEcomCountryCode]
,[AreaEcomShopID]
,[AreaUrlIgnoreForChildren]
,[AreaItemType]
,[AreaItemId]
,[AreaCookieWarningTemplate]
,[AreaCookieCustomNotifications]
,[AreaItemTypePageProperty]
,[AreaIncludeProductsInSitemap]
,[AreaSSLMode]
,[AreaEcomPricesWithVat]
FROM Area WHERE AreaID = @SourceAreaID
SET IDENTITY_INSERT Area OFF

UPDATE Page SET PageAreaID = @DestinationAreaID WHERE PageAreaID = @SourceAreaID

// Martin


Replies

 
Nicolai Høeg Pedersen
Reply

I believe this would work.

Make sure to reset IIS after the update.

 
Martin Nielsen
Reply

I already tried it, and everything seems to work after restarting the App Pool.

I'm just wondering if there is something else i need to change for everything to work correctly in all parts of Dynamicweb.

Is the area ID only used in thse two tables: Area and Page?

 
Nicolai Høeg Pedersen
Reply

Well yes, and also in some item settings. So if you have defined which item types are available in which websites, they also use the area ID.

There might be other settings like that, but it is not many.

 

You must be logged in to post in the forum