Backup And Restore A Site Collection In SharePoint 2013

Backup And Restore A Site Collection In SharePoint 2013
======================================================

In this blog post, I will show you how to backup and restore a site collection in SharePoint 2013 using PowerShell and Central Administration. A site collection is a group of sites that share common features, such as content types, permissions, and navigation. Backing up a site collection allows you to save the site collection data and configuration to a file that can be restored later. Restoring a site collection allows you to recover a site collection from a backup file in case of data loss or corruption.

Backup a site collection using PowerShell
----------------------------------------

You can use PowerShell to backup a site collection manually or as part of a script that can be run at scheduled intervals. To backup a site collection using PowerShell, you need to have the following memberships:

- securityadmin fixed server role on the SQL Server instance
- db_owner fixed database role on all databases that are to be updated
- Administrators group on the server on which you are running the PowerShell cmdlets

You can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint Server cmdlets. If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions.

To backup a site collection using PowerShell, follow these steps:

1. Start the SharePoint Management Shell.
2. At the PowerShell command prompt, type the following command:

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

    Where:

    - <SiteCollectionURL> is the URL of the site collection you want to backup
    - <BackupFile> is the path and name of the backup file
    - -Force is an optional parameter that overwrites an existing backup file with the same name
    - -NoSiteLock is an optional parameter that prevents SharePoint from setting the site collection to read-only during the backup
    - -UseSqlSnapshot is an optional parameter that uses a SQL Server snapshot to create the backup instead of locking the database
    - -Verbose is an optional parameter that displays detailed information about the backup process

3. Wait for the backup operation to complete. You can check the progress of the backup by using the Get-SPBackupRestoreJob cmdlet.

Backup a site collection using Central Administration
-----------------------------------------------------

You can also use Central Administration to backup a site collection in SharePoint Server. To backup a site collection using Central Administration, you need to be a member of the Farm Administrators group.

To backup a site collection using Central Administration, follow these steps:

1. Start Central Administration.
2. In Central Administration, on the home page, in the Backup and Restore section, click Perform a site collection backup.
3. On the Site collection backup page, select the site collection from the Site Collection list.
4. Type the local path of the backup file in the Filename box.
5. Click Start Backup.
6. Wait for the backup operation to complete. You can check the status of the backup by clicking Refresh.

Restore a site collection using PowerShell
-----------------------------------------

You can use PowerShell to restore a site collection manually or as part of a script that can be run at scheduled intervals. To restore a site collection using PowerShell, you need to have the same memberships as for backing up a site collection.

To restore a site collection using PowerShell, follow these steps:

1. Start the SharePoint Management Shell.
2. At the PowerShell command prompt, type the following command:

    Restore-SPSite -Identity <SiteCollectionURL> -Path <BackupFile> [-DatabaseServer <DatabaseServerName>] [-DatabaseName <ContentDatabaseName>] [-HostHeader <HostHeader>] [-Force] [-GradualDelete] [-Verbose]

    Where:

    - <SiteCollectionURL> is the URL for the site collection you want to restore
    - <BackupFile> is the path and name of the backup file
    - <DatabaseServerName> is an optional parameter that specifies the name of the database server where the site collection resides
    - <ContentDatabaseName> is an optional parameter that specifies the name of the content database where the site collection resides
    - <HostHeader> is an optional parameter that specifies the URL of the web application that will hold the host-named site collection
    - -Force is an optional parameter that overwrites an existing site collection with the same URL
    - -GradualDelete is an optional parameter that improves performance by deleting

Comments

Popular posts from this blog

Introduction to Structured Query Language