Copysettings script

Introduction

The copy settings script can be used to:

  • Copy UCC sites
  • Backup and Restore UCC sites
  • Move 5.2 Template Sites to a new 6.0 UCC Creator Site collection

 

Preparations

  1. Download the zipfile called CopySettings
  2. Make sure that the .zip package is unblocked.
    Right click on the .zip file and choose ‘properties’
    Then click Unblock and Apply

 

Configure Properties

  1. Edit the properties file (will open in PowerShell ISE).

  2. Set inputOperation:
    1. backup = Create a local backup of the UCC site(s), can be used to restore to a new or the same location

    2. restore = Restore a local backup to SharePoint

    3. sidebyside = Do a backup and restore in one go, useful when moving to a new site collection (for example 5.2 to 6.0)

      Note With sidebyside the input for the restore needs be enter separately under the header "Side by side configuration".

  3. Fill in the site URL (this is the url of the main site collection which contains all ucc sites.) The single site can be selected when the script is executed.

  4. Choose the authentication method:
    1. User Authentication:
      1. inputUsername = Domain and Username of the UCC Service account or SharePoint Online account)

      2. inputPassword = (Encrypted) Password of the account

      3. inputPasswordEncrypted = Enable or disable that the password needs to be encrypted.

        Note Encrypt password script is located in the same folder as the properties.ps1.

    2. App Authentication (SPOnline only):
      1. inputAppId = ClientId is the id created during the installation of the UCC Creator, Learn More
      2. inputAppSecret = ClientSecret is the client secret created during the installation of the UCC Creator, Learn More
  5. Select client mode:
    1. 2010 = SharePoint 2010 on-premises
    2. 2013 = SharePoint 2013 on-premises
    3. 2016 = SharePoint 2016 on-premises
    4. 2019 = SharePoint 2019 on-premises
    5. online = SharePoint Online
  6. Select SharePoint version:
    1. inputv2Template - y = SharePoint template 6.0 (UCC Creator)
    2. inputv2Template - n = SharePoint template 5.2
  7. Select which libraries should be copied. (Libraries are larger and will take longer to copy)

  8. Select is the permissions should be copied.

    Warning Make sure the account exist when moving the a new environment (For example to SharePoint Online)

  9. (Optional) point to the path for the UCC Creator. This is needed for sidebyside or restore the an UCC creator site collection.

  10. Save the properties file

 

Backup - Execute script

  1. Open PowerShell as administrator

  2. Navigate to the copysettings folder.

  3. Run the sptemplate_copysettings script.

  4. You will be able to select the site you want to backup

  5. A new folder will be created inside the copysettings folder with the name SettingsBackup

 

Restore - Execute script

Scenario A. to recreate ucc settings sites in the same site collection

  1. In the backup folder rename the ucc folder name to the new name.

  2. Edit the properties file and use restore mode

  3. The script will ask if you want to overwrite. This is ok because the name is changed and a new site is created.

  4. Your new site is created and you can change the url in the ucc config to the new site.

 

Scenario B. to move a site to a new site collection

  1. Edit the properties file

  2. Use restore mode and change the siteurl into the new sitecollection

  3. The script will ask if you want to overwrite. This is ok because the sitecollection is new.

  4. Your new site is created and you can change the url in the ucc config to the new site.

 

Scenario C to change the site prefix for a UCC site

When you want to restore a certain UCC from a backup, you have the possibility to adjust the UCC Config Site name by adding a new prefix, that will display on the new URL of the target location.

 

1. Open the properties file and scroll down to #restore site with prefix

2. Enable the feature with yes

$inputTargetSitePrefix = "y" # yes/no

3. Add the prefixold and the prefixnew inside brackets

$inputTargetSitePrefixOld = ""

$inputTargetSitePrefixNew = ""

4. When you run the script next time and the feature is enabled, you will be able to change the name (site URL) from all selected backup UCCs (prefixold) to be restored with a new prefix (prefixnew).

 

Example

You have created a backup for UCC = app25 and want to restore as ucc_app25

Prefixold = "empty", prefixnew ="ucc_"

You have created a backup for UCC = ucc_app25 and want to restore as ucc_super_app25

Prefixold="ucc", prefixnew ="ucc_super"

You have created a backup for UCC = ucc_super_app25 and want to restore as app25

Prefixold="ucc_super_", prefixnew ="app25"

 

SidebySide - Execute script

  1. Open PowerShell as administrator

  2. Navigate to the copysettings folder.

  3. Run the sptemplate_copysettings script.

  4. You will be able to select the site you want to backup

  5. A new folder will be created inside the copysettings folder with the name SettingsBackup

  6. The script will now restore the backed up sites to the target Site collection