Back up and restore Persistent Chat databases in Skype for Business Server 2015

Summary: Learn how to back up and restore Persistent Chat Server databases in Skype for Business Server 2015.

Persistent Chat Server requires SQL Server database software to store chat room data, such as history and content, configuration, user provisioning, and other relevant metadata. In addition, if your organization has regulations that require Persistent Chat activity to be archived, and the optional Compliance service is enabled, SQL Server database software is used to store compliance data, including chat content and events, such as joining and leaving rooms. Chat room content is stored in the Persistent Chat database (mgc). Compliance data is stored in the Compliance database (mgccomp). This is business-critical data that should be backed up regularly.

Back up the databases

There are two ways of backing up Persistent Chat data.

  • SQL Server Backup

  • The Export-CsPersistentChatData cmdlet, which exports Persistent Chat data as a file

Data that is created by using SQL Server backup requires significantly more disk space—possibly 20 times more—than that created by the Export-CsPersistentChatData cmdlet, but SQL Server backup is likely to be a procedure with which you are familiar.

If you want to use SQL Server backup procedures, see your SQL documentation for more information.

If you want to use the Export-CsPersistentChatData cmdlet, you can specify the command as follows:

Export-CsPersistentChatData [-FileName <String>] <COMMON PARAMETERS>


Export-CsPersistentChatData [-AsBytes <SwitchParameter>] <COMMON PARAMETERS>

For example, the following command exports Persistent Chat data from the Persistent Chat database located on the server; the exported data will be stored in the file C:\Logs\ Because the Level parameter was not specified, the command will do a full export of the Persistent Chat information:

Export-CsPersistentChatData -DBInstance "\rtc" -FileName "C:\Logs\"

Restore the databases

How you restore your Persistent Chat data depends on the method that you used to back it up. If you used SQL Server backup procedures, you must use SQL Server restore procedures. If you used the Export-CsPersistentChatData cmdlet to back up Persistent Chat data, then you must use the Import-CsPersistentChatData cmdlet to restore the data:

Import-CsPersistentChatData -FileName <String> <COMMON PARAMETERS>


Import-CsPersistentChatData -ByteInput <Byte > <COMMON PARAMETERS>