Friday, August 5, 2011

Converting a site to a Site collection

Creating a site collection from site

1. Below I am creating a new database, since my site is a publishing site I will be creating a blank publishing site.

create new site in its own DB using the below cmstemplate

a. $w=Get-SPWebApplication("http://shareptapptest:9002")

b. New-SPContentDatabase "WSS_Content_Internet_Hosted_Sites_3" -DatabaseServer "shareptDBtest" -WebApplication $w

c. new site : here I am creating a blank publishing template which cannot be created from UI

New-SPSite http://shareptapptest:9002/hostedsites -OwnerAlias testdomain\testadmin -Name "SITENAME" -Template "cmspublishing#0"

2. Export the site http://shareptapptest/hostedsites/SUBSITE :

stsadm -o export -url http://shareptapptest/hostedsites/SUBSITE -filename "C:\Deployments\Release2-Technical Upgrade\SUBSITE06142011.bak"

3. Makig sure all site collection and sub site features\ spolutions are activated on the new site collection

a. Make sure all solutions are activated for this site collection as well.

b. Or what you can do is also make sure that all the features that are activated on the source are activated on this site collection as well.

4. Import the exported data using the below command.

stsadm -o import -url http://shareptapptest:9002/Hostedsites -filename "C:\Deployments\Release2-Technical Upgrade\SUBSITE06142011.bak"

5. Potential Issues :

a. when i tried to run the website it bombed out becuase i think it could not find the master page.

b. The master gallery exists only on the site collection level so a site might be pointing to the site collection;s master page in which case when it is exported out the master page will not be exported.

c. Also the publishing images library which is “images” is usually in the stie collection so all images pointing to this will not be visible.

6. to copy the MASTER PAGE : Open 2 instances of SPD , 1 for each website, Copy the master pages from SUBSITE using Sharepoint Designer, copy the 2 master pages from the "MAster PAges"

7. This is used to fix the page layout, if you see the layout of the pages in the document library in SP Designer you will see that the page layout is still pointing to the old server;s pagelayout. Below command will fix the page layout

a. install gary extensions using the below commands

i. Download them from the internet, do a search for Gary Lapointe extensions and you will find them.

Add-SPSolution C:\Deployments\Release2-Technical Upgrade\Lapointe.SharePoint2010.Automation.wsp

Install-SPSolution -Identity Lapointe.SharePoint2010.Automation.wsp -GACDeployment

stsadm -o gl-repairsitecollectionimportedfromsubsite -sourceurl http://mossappdev10:9006/hostedsites/chphc -targeturl http://mossappdev10:9005/hostedsites


Of what you can do is that instead of installingand running these commands, in SPD Deattach and Reattach the page layout and if it refers to the pagelayout on the same server then it is fixed.
8. For any images missing fix the hardcoded references to this SITE when it was the subsite.

No comments:

Post a Comment