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