Restore apps for SharePoint in SharePoint 2013


Applies to: apps for SharePoint, SharePoint Foundation 2013, SharePoint Server 2013

Topic Last Modified: 2018-01-27

Summary: Learn how to restore apps for SharePoint in SharePoint 2013.

You can restore an apps for SharePoint environment by using the SharePoint Central Administration website, Windows PowerShell, or SQL Server tools. The restore tool that you use depends on the kind of environment that you have deployed, your schedule requirements, and service level agreements that you have with your organization. The app for SharePoint content and packages are stored in the SharePoint 2013 content databases in individual site collections. The restore process requires you to restore all services that the app references. The apps for SharePoint can reference the following SharePoint 2013 databases which you may have to restore. You should also restore the site collection where the app for SharePoint is located if you are restoring the apps for SharePoint to the same environment.

  • Content

  • Configuration

  • Secure Store Service application

  • App Management service application

For more information about the SharePoint 2013 databases, see Database types and descriptions (SharePoint 2013).

In this article:

Content databases can store data for multiple site collections. If you have apps for SharePoint hosted in many site collections you may also have multiple content databases. To back up and restore all of the apps for SharePoint in your environment, you must back up and restore all content databases and site collections in the farm.

Because SharePoint 2013 runs as websites in IIS, administrators and users depend on the accessibility features that browsers provide. SharePoint 2013 supports the accessibility features of supported browsers. For more information, see the following resources:

You can restore a single content database or several content databases one at a time. For information about how to restore a content database in a farm, see Restore content databases in SharePoint 2013. For information about how to back up and restore all the content databases in a farm at the same time, see Back up farms in SharePoint 2013.

In SharePoint 2013 you do not have to restore the configuration database because you can restore the farm configuration directly. For more information, see Restore farm configurations in SharePoint 2013.

The Secure Store Service database stores and maps credentials to specific identities or a group of identities. You must have the passphrase that was recorded when the Secure Store Service was backed up to restore it. To restore the Secure Store database, see Restore Secure Store Service in SharePoint Server 2013.

The App Management service application database stores the app licenses and permissions for all apps downloaded from the App Catalog site in SharePoint 2013. You must restore this database to make sure that the apps for SharePoint licenses and permissions are available in your farm. To restore the App Management database, follow the same procedures as most other SharePoint 2013 service applications. For more information, see Restore service applications in SharePoint 2013.

You can only restore a site collection in SharePoint 2013 by using Windows PowerShell. Use this section to restore a site collection that contains apps for SharePoint to the same SharePoint 2013 environment. To restore to a new farm, see Restore apps for SharePoint to a new farm.

Any apps for SharePoint that contain remote components that are present on the backup copy of a site collection could cause problems. This is because two copies of the app for SharePoint are accessing the remote connection and can cause information disclosure or data loss. For example, when a site collection in a production environment is copied by a backup for a development purpose, this could unintentionally grant developers access to production data in remote sites if the app for SharePoint is not designed correctly.
To restore a site collection by using Windows PowerShell
  1. Verify that you 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 Windows PowerShell cmdlets.

    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 Products cmdlets.

    If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Add-SPShellAdmin.
  2. Start the SharePoint 2013 Management Shell.

    • For Windows Server 2008 R2:

      1. On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.

    • For Windows Server 2012:

      • On the Start screen, click SharePoint 2013 Management Shell.

        If SharePoint 2013 Management Shell is not displayed on the Start screen:

      • Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.

    For more information about how to interact with Windows Server 2012, see Common Management Tasks and Navigation in Windows Server 2012.

  3. At the Windows PowerShell command prompt, type the following command:

    Restore-SPSite -Identity <SiteCollectionURL> -Path <Backup file> [-DatabaseServer <DatabaseServerName>] [-DatabaseName <ContentDatabaseName>] [-HostHeader <Host header>] [-Force] [-GradualDelete] [-Verbose]


    • <SiteCollectionURL> is URL for the site collection you want to restore.

    • <DatabaseServerName> is name of the database server where the site collection resides.

    • <ContentDatabaseName> is the name of the content database.

    If you want to restore the site collection to a specific content database, use the DatabaseServer and DatabaseName parameters to specify the content database. If you do not specify a content database, the site collection will be restored to a content database chosen by SharePoint 2013.

    If you are restoring a host-named site collection, use the Identity parameter to specify the URL of the host-named site collection and use the HostHeader parameter to specify the URL of the web application that will hold the host-named site collection.

    If you want to overwrite an existing site collection, use the Force parameter.

    If the site collection that you are restoring is 1 gigabyte or larger, you can use the GradualDelete parameter for better performance during the restore process. When this parameter is used, the site collection that is overwritten is marked as deleted, which immediately prevents any additional access to its content. The data in the marked site collection is then deleted gradually over time by a timer job instead of all at the same time, which reduces the effect on server performance.

    For more information, see Restore site collections in SharePoint 2013

    For more information, see Restore-SPSite.

    We recommend that you use Windows PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.

To restore apps for SharePoint to a new farm you must also backup and restore any services that the app references. These SharePoint 2013 service applications can include the Secure Store Service service application, Access Services in SharePoint Server 2013, and the App Management Service. For more information, see the following articles: