Archive for SharePoint 2010

PowerShell script to back up a SharePoint 2010 Site Collection with a unique (date/time) filename

This PowerShell script will backup a SharePoint 2010 (Host Header URL) Site Collection to a single .BAK file with a date and time filename.

Replace the following with your own values:
bkupLoc = NTFS share that .BAK file will be written to.
sitecoll = the URL of your site collection (I’m using it for a HHURL site collection).

Add-PsSnapin Microsoft.SharePoint.Powershell
#Backup location
$bkupLoc = “\\server\share\myscbkupfolder\
#Date
$adate =get-date
#Site collection location
$sitecoll = “http://mysitecoll.mydomain.com
#daily filename
$bkupfile = $bkupLoc+”{0:ddMMMyyyyhhmm}”-f$adate+”.bak”
Backup-SPSite -Identity $sitecoll -Path $bkupfile

Advertisements

Leave a Comment

Moving a SharePoint 2010 Host Header Site Collection to a new server in a new domain.

This example describes how to move a SharePoint 2010 Host Header (HHURL) site collection from a server in domaina to a new server in domainb. The example also deals with migrating users within the HHURL site collection from domaina to domainb.

The existing HHURL site collection is http://existing.domaina.com currently on hosta and Content Database is existingDB.
Create a new HHURL site collection on http://mynewsc.mydomainb.com on hostb and Content Database is mynewscDB.
Ensure your DNS record for the new HHURL site collection is mapped correctly i.e. you can get to it from the outside world.
Login to the new site collection and verify.
Backup the existing site collection http://existing.mydomaina.com on hosta to scbackup.bak file using Central Admin > Backup & Restore > Granular Backup > Perform a Site Collection Backup. Read the rest of this entry »

Comments (3)