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 a new site in its own DB using the below cmstemplate
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. Making sure all site collection and subsite 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 because 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 site 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 page layout. 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