神刀安全网

Get Backup And Restore Site Collection in SharePoint

Below are the sample commands that run on SharePoint Management Shell.

BackUp Site Collection

Backup Site Collection using SharePoint PowerShell

Syntax:

Backup-SPSite -Identity <SiteCollectionGUIDorURL> -Path <BackupFile>[-Force] [-NoSiteLock] [-UseSqlSnapshot] [-Verbose]

Parameters Explanations

SiteCollectionGUIDORURL

This parameter is necessary. This parameter represents the site from which you need to take backup. We can use any one of them (ID or Site URL).

Site URL Example :<SiteCollectionGUIDORURL> will replace by ( http://something1:6060/ ) or " 01234567-89ab-cdef-0123-456789abcdef" .

Path

This parameter is necessary. This parameter requires relative path from where you can save the backup file. In addition, backup file extension should be like this (.bak)

Backup Path Example : <BackupFile>will replace by ("C:/site.bak")

Force

This parameter is optional. But when you need to overwrite existing backup file you can use this parameter.

NoSiteLock

This parameter is optional. Specifies the site collection to remain read and write during the backup. Ordinarily, when you backup site collection it will prevent user for read and write, which means, during backup user will no longer have access to a particular site. This is the default behavior. But if you want to let them, user can read and write site (Backup Site), then we use this parameter. In addition, it will cause corruption in backup.

UseSqlSnapshot

This parameter is optional. This parameter creates a snapshot of SQL database when starting backup. Moreover, this snapshot will be removed automatically after backup finishes or completes. This will allow user to use site during backup and they have rights for reading and writing. It is not necessary to specify the NositeLock parameterwhenspecifying the SQLSnapShotparameter .

Some Examples with and without parameters

Backup-SPSite http://server_name/sites/site_name -Path C:/Backup/site_name.bak

Restore Site Collection

Restore site collection using PowerShell.

Syntax


Parameters Explanations

SiteCollectionURL:

This parameter is necessary. This parameter represent the site from whomfrom which you want to restore. We use any one of them (URL).

Site URL Example:

<SiteCollectionURL> will replace by (http://something1:6060/)

Path

This parameter is necessary.This parameter require value is at which, you have save in the directory. Moreover, backup file extension should be like this (.bak)

Backup Path Example : <BackupFile> will replace by ("C:/site.bak")

Restore-SPSite -Identity http://CreatNewSiteCollection -path C:/TestBackup.bak

DatabaseServerName:

This is the optional parameter. This is name of database server where site collection resides. Moreover , database server name should be correct. It is not necessary to specify name. Instead of not using database name, SharePoint will take care of it by own.

ContentDatabaseName:

This is the optional parameter. Furthermore, it is necessary to specify.

ContentDatabaseName parameter when specifying DatabaseServerName .

Force

This parameter is optional. But when you need to overwrite existing backup file. You can use this parameter.

GradualDelete:

Specifies that the site collection being overwritten with the Force parameter should be gradually deleted over time by a timer job instead of all at once, which reduces its impact on SharePoint 2010 Products and SQL Server performance. This option is recommended for large site collections.

HostHeaderWebApplication:

A valid URL assigned to the Web application by using alternate access mapping, such as:

http://server_name.

Restores a site collection as a host-named site collection instead of a path-based site collection. When the HostHeaderWebApplication parameter is present, the value of the Identity parameter is the URL of the host-named site collection and the value of the HostHeaderWebApplication parameter is the URL of the Web application that will hold the host-named site collection

Hope you understand. If you have any query please contact me. I would love to answer your query.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Get Backup And Restore Site Collection in SharePoint

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址