Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Moving pages from one portal  to another portal.Moving pages from one portal to another portal.
Previous
 
Next
New Post
10/6/2009 2:54 PM
 

Hello !
I use dnn 4.9.5  and i have two sites on one dnn instance.
Task is to get one site from two sites.
So , Can I move pages from one portal (PortalID=1) to another portal (PortalID=0) through statement:
UPDATE dbo.dnn_Tabs SET
dbo.dnn_Tabs.PortalID=0
WHERE dbo.dnn_Tabs.PortalID=1 and dbo.dnn_Tabs.IsSecure=0
?
But i'm not sure that it's so simple...

Is there another way to resolve this task ?

Thanks ,
Kirill.
 

 
New Post
10/6/2009 4:35 PM
 

depending on the number of pages, export/import should be more safe

otherwise exclude admin pages and you need to move modules as well and some adjacent tables like permissions, where you have to reconfigure permissions, due to different role IDs .


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
10/7/2009 12:22 PM
 

Thanks for answer.
Ok.
I have around 350 pages for import , so it can be hard work , if i  export/import every page step by step.
but more safe ...

Well, about
UPDATE [Tabs] SET
[Tabs].PortalID=0
WHERE [Tabs].PortalID=1 AND
[Tabs].IsSecure=0
 
1) [Tabs].IsSecure=0  - does it exclude admin pages ?

2) >>you need to move modules
I use same dnn instance , so all modules already exist for all portals

3) user permissions : can i check it after moving ?

4) also i think about resourses (images or any other files) ,
I tried to make export/import , but after export/import with contents image had references to old portal .
As i understand , i should move resourses from old portal to another by hand and check reference after .. 

5) also i use 3\part modules , same as Simple Gallery , but it's question to these modules.

Ok, i think about these two ways (export/import and SQL changing) , I think to go by way export/import.
More haste , less speed.
but >350 pages... ))

Thanks ,
Kirill.

 
New Post
10/14/2009 3:29 PM
 

Hello.
If I use export/import i will lose links ... and will have to create actually a new portal.
ok...
I try to run following script:
(this script is more specific for my portal)
-- Task : Move portal PortalID=1 to existing portal PortalID=0
-- tables prefix : dnn_
-------------------------

DECLARE @portal_to int
DECLARE @portal_from int
SET @portal_to=0
SET @portal_from=1
-------------------------
-- moving modules
UPDATE dbo.dnn_Modules SET
dbo.dnn_Modules.PortalID=@portal_to
FROM dbo.dnn_Modules
INNER JOIN dbo.dnn_TabModules ON dbo.dnn_Modules.ModuleID=dbo.dnn_TabModules.ModuleID
INNER JOIN dbo.dnn_Tabs ON dbo.dnn_TabModules.TabID=dbo.dnn_Tabs.TabID
AND dbo.dnn_Tabs.PortalID=@portal_from
AND dbo.dnn_Tabs.IsSecure=0
AND dbo.dnn_Tabs.TabName<>'Search Results'
WHERE dbo.dnn_Modules.PortalID=@portal_from
-------------------------
-- moving pages
DECLARE @MaxTabOrder int
SELECT @MaxTabOrder=MAX(dbo.dnn_Tabs.TabOrder) FROM dbo.dnn_Tabs
WHERE dbo.dnn_Tabs.PortalID=@portal_to AND dbo.dnn_Tabs.TabOrder < 10000
--SET @MaxTabOrder=5000
UPDATE dbo.dnn_Tabs SET
dbo.dnn_Tabs.PortalID=@portal_to ,
dbo.dnn_Tabs.TabOrder = dbo.dnn_Tabs.TabOrder + @MaxTabOrder -- put under existing pages
WHERE dbo.dnn_Tabs.PortalID=@portal_from and dbo.dnn_Tabs.IsSecure=0 and
dbo.dnn_Tabs.TabName<>'Search Results'
--and dbo.dnn_Tabs.TabName<>'Site map'

-------------------------
-- moving permissions
DECLARE @role_admin_to int -- 'Administrators'
DECLARE @role_reg_users_to int -- 'Registered Users'
DECLARE @role_subscribers_to int -- 'Subscribers'

DECLARE @role_admin_from int -- 'Administrators'
DECLARE @role_reg_users_from int -- 'Registered Users'
DECLARE @role_subscribers_from int -- 'Subscribers'

-- table Roles
SET @role_admin_to = 0 -- 'Administrators' PortalID=0
SET @role_reg_users_to = 1 -- 'Registered Users' PortalID=0
SET @role_subscribers_to = 2 -- 'Subscribers' PortalID=0

SET @role_admin_from = 3 -- 'Administrators' PortalID=1
SET @role_reg_users_from = 4 -- 'Registered Users' PortalID=1
SET @role_subscribers_from = 5 -- 'Subscribers' PortalID=1
--------------------------------------------------------------
UPDATE dbo.dnn_TabPermission
SET dbo.dnn_TabPermission.RoleID=@role_admin_to
WHERE dbo.dnn_TabPermission.RoleID=@role_admin_from

UPDATE dbo.dnn_TabPermission
SET dbo.dnn_TabPermission.RoleID=@role_reg_users_to
WHERE dbo.dnn_TabPermission.RoleID=@role_reg_users_from

UPDATE dbo.dnn_TabPermission
SET dbo.dnn_TabPermission.RoleID=@role_subscribers_to
WHERE dbo.dnn_TabPermission.RoleID=@role_subscribers_from
---------------------------------------------------------------
-------------------------
-- updating user roles
UPDATE dbo.dnn_UserRoles
SET dbo.dnn_UserRoles.RoleID=@role_admin_to
WHERE dbo.dnn_UserRoles.RoleID=@role_admin_from

UPDATE dbo.dnn_UserRoles
SET dbo.dnn_UserRoles.RoleID=@role_reg_users_to
WHERE dbo.dnn_UserRoles.RoleID=@role_reg_users_from

UPDATE dbo.dnn_UserRoles
SET dbo.dnn_UserRoles.RoleID=@role_subscribers_to
WHERE dbo.dnn_UserRoles.RoleID=@role_subscribers_from
-------------------------
-- moving users
UPDATE dbo.dnn_UserPortals
SET dbo.dnn_UserPortals.PortalId=@portal_to
WHERE dbo.dnn_UserPortals.PortalId=@portal_from
AND dbo.dnn_UserPortals.UserId<>490 --id:490 multi portal user
-------------------------
-- updating links ( copy all files from /Portals/1/ to /Portals/0/en/)
UPDATE dbo.dnn_HtmlText SET
DesktopHtml = REPLACE(Cast(DesktopHtml AS NVARCHAR(Max)),'/Portals/1/', '/Portals/0/en/')
WHERE DesktopHtml LIKE '%/Portals/1/%'
-------------------------
-- And last step login as superuser and delete portal 1
----------------------------------------------------


Can you tell me have correct this script is ?
maybe i have missed something...

Thanks ,
Kirill.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Moving pages from one portal  to another portal.Moving pages from one portal to another portal.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out