0

I have a site collection that is published externally and is constantly getting updated with newer versions of files. The business has a requirement where we need some external users to only see information up to a certain point in time like a snapshot.

I wanted to make a template of the site collection and include the content and then simply give these external users the new URL. Job done. Obviously now I have done some research I realised that I cannot do a template of a site collection. The reason it has to be a site collection is because we had a custom solution built for us by a professional SP development company that when activated it programmatically creates a new site collection with all this smart routing etc. Is there a way I can do this or does anyone have any alternative idea's? Many thanks

1 Answer 1

3

create a new web application and a temp site collection - the site collection should have the same template as the one your going to overwrite it with (e.g. team site)

once that is done, use powershell to backup the site collection and use restore to restore over the temp site collection you created in the first step within the new web application.

Backup-SPSite (site collection level)

Backup-SPSite http://tempsite:12345/sites/mysite -Path C:\Backup\site_name.bak

http://technet.microsoft.com/en-us/library/ff607901(v=office.15).aspx

Restore-SPSite (Site collection level)

Restore-SPSite http://tempsite:54321/sites/mysite -Path C:\Backup\site_name.bak

http://technet.microsoft.com/en-us/library/ff607788(v=office.15).aspx

EDIT

no its not possible, the backup and restore is full fidelity, that means it keeps alerts and workflows but it also means that the ID's are the same so it would cause a conflict and fail on restoring! you could give it a try tho but will lead to dissapointment.

The only guid that changes is the root site level which is the origional site collection level that you create that is overwriten.

but what your refering to is different, that can be achived by using the copy function:

Copy-SPSite http://contoso/sites/OldTeam -DestinationDatabase WSS_Content -TargetUrl http://contoso/sites/NewTeam

http://technet.microsoft.com/en-us/library/fp161280(v=office.15).aspx

giving a new name, the method above... dont create a new site collection within the web application, rather only run the powershell code, the targeturl you copy the source url location but rename it to the site url you want eg.

source url      : http://mysitepage.com/sites/origionalSite
destination url : http://mysitepage.com/sites/MyNewSiteURL

so my new copy of the source site is now called MyNewSiteURL.

sharepoint 2013

Copy-SPSite http://mysitepage.com/sites/origionalSite -DestinationDatabase WSS_Content -TargetUrl http://mysitepage.com/sites/MyNewSiteURL

sharepoint 2010

there is no copysite in sharepoint 2010 but what we do have is export and import. This tho is not full fidelity and will generate new GUIDS for lists and web objects, all associations are lost like alerts and workflows!

Export-SPWeb [-Identity] -Path [-AppLogFilePath ] [-AssignmentCollection ] [-CompressionSize ] [-Confirm []] [-Force ] [-HaltOnError ] [-HaltOnWarning ] [-IncludeUserSecurity ] [-IncludeVersions ] [-ItemUrl ] [-NoFileCompression ] [-NoLogFile ] [-UseSqlSnapshot ] [-WhatIf []]

http://technet.microsoft.com/en-us/library/ff607895.aspx

url above shows its for 2013 but same applies for 2010!

you can export at sitecollection level, site level or document level.... all depends on the url you give. In your case you want to export a specific site than you would do the following:

export

Export-SPWeb -Identity http://mysitepage.com/sites/origionalSite -Path C:\Backup\site_name.bak -Force 

import

Import-SPWeb -Identity http://mysitepage.com/sites/MyNewSiteURL -Path C:\Backup\site_name.bak -Force 
9
  • Thanks for the info. I have looked at this PS command. Is there a way of adding it back to the same web app but with a different URL and Name?
    – JazzyN
    Aug 22, 2014 at 10:30
  • just ammended my answer
    – Ali Jafer
    Aug 22, 2014 at 10:55
  • This looks like exactly what I want, thanks. Before I try it do you know 1) Is all the content included I,e, documents 2) There is no connection between the original and copy i.e. if a library is updated in the original the copy will not update along with it? 3) can it be copied to the same content DB?
    – JazzyN
    Aug 22, 2014 at 11:56
  • either way this is the deservedly marked answer. Thanks
    – JazzyN
    Aug 22, 2014 at 11:57
  • 1
    @CameronVerhelst yes your right but op is looking for a template or copy of the origional site rather than moving it to another location! only the structured content database is copied and site must already exist. "content database specified must already exist, must be attached to the same SQL Server " technet.microsoft.com/en-us/library/ff607915(v=office.15).aspx
    – Ali Jafer
    Sep 12, 2014 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.