Knowledge Base

How to restore Microsoft Teams data?

Unlike all other Office 365 services, Teams data is not stored in a single location. It’s stored in different places and this table summaries where each data is stored.

One-to-one chat Text messages in one-to-one chat Stored in a hidden folder in the users’ mailboxes. Each member of the chat retains a copy within their mailboxes.
Files shared during the chat Stored in users’ OneDrive for Business accounts in a folder called Microsoft Teams Chat Files.
Group chats Text messages in group chats Stored in a hidden folder within the users’ mailboxes. Each member of the group chat retain their own copy.
Files shared during the chat Stored in users’ OneDrive for Business accounts in a folder called Microsoft Teams Chat Files.
Chat within a channel Text messages and files in a channel Stored in the group mailbox.
Files in that channel chat Stored in a document library that is created within the SharePoint Online site. Each channel has a separate document library within the same SharePoint Online site.

To get an idea where each component is stored in RecoveryManager Plus’s backup, let’s imagine that we have the following scenario.

  1. A user Edward Francis has a couple of one-to-one chat with users Brew Henry and Stewart.
  2. microsoft-teams-one-to-one-chat

  3. He’s also a participant in a Team chat called Marketing Analysis which has two channels, General and Designers Channel, in it.
  4. microsoft-teams-channel-chat

    The General channel also contains several SharePoint site pages and a message with attachment.

Finding the places where the data is stored in backups

One-to-one chats

  1. To find where the one-to-one chat data is stored in the backups, open RecoveryManager Plus and explore the backup of Edward Francis’s mailbox.
  2. In the backup, navigate to Conversation history → Team Chat.
  3. microsoft-team-chat-in-recovery-manager-plus

  4. In the backup, every message sent or received by Edward Francis is stored. The From and To fields allow us to interpret who the original sender and the participants of the chat are. In this case, the original sender is Edward Francis and the participants are Brew Henry and Stewart.
  5. Image attachments sent in one-to-one chat are also stored in the backup.

Team chats

Every message sent on a Team chat is stored in a mailbox called ‘<Team_name>@<orgname>.onmicrosoft.com’ which will be automatically created with the channel. In this case, it’s marketinganalysis@<orgname>.onmicrosoft.com.

Image attachments sent in Team chats are also stored in the backup.

microsoft-team-chat-backup-in-recovery-manager-plus

Any file shared in the chat which is not an image will be stored in a different location.

  • Files shared in one-to-one chats are stored in the OneDrive for Business account of the user who shared the file, with the recipient being provided access to the file automatically.
  • Files shared in Teams message are stored in a SharePoint Online site. A new site will be created with the name of the Team and the files are stored there. In this case, a site called Marketing Analysis will be created and the files are stored there. The files are automatically shared to all the members in the Teams chat.

Files attached to team chats

All files that were attached to messages inside Team channels are stored in a corresponding subfolder inside the Documents folder.

sharepoint-and-one-drive-documents

OneNote notes

All OneNote notes for it are stored in Site Assets folder alongside default site icon.

sharepoint-and-one-drive-site-assets

What are the items that can be restored directly?

The items that are stored in the following places can be directly restored to Office 365 and Teams:

  • SharePoint Team sites and their subsites
  • Files attached to Team and chat messages
  • Team OneNote Notebooks

To restore files attached to Teams and chat messages and Team OneNote Notebooks, follow the steps listed here.

Other types of data messages such as personal 1-to-1 chats, chats to multiple recipients or to all Team channel members can also be restored to the original location in Office 365, but Teams won't be able to automatically recognize and import this data.

Manually restoring messages to Teams Channels

There are 3 steps to restore messages to Team channels:

  1. Creating a Webhook.
  2. Converting the backup data into a .txt file.
  3. Importing text chats to Teams using PowerShell.

Creating a Webhook

Microsoft Teams supports Webhook as a way to send messages to Team channels. Webhooks can be used to import any messages that have been removed. The imported messages will have the date of import as the message date and ‘Webhook’ will be the name of the sender, but the original date and time of the message and the name of the sender can be included in the text.

To perform manual restoration, create a Webhook that will allow you to send messages to the Teams Channel from the internet using PowerShell.

  • Select the channel you want to restore, right-click on it, and select Connectors.
  • microsoft-teams-channel-restore

  • Click the Add button against the Incoming Webhook option and the click Configure.
  • incoming-webhook-configure

  • Specify the name of your Webhook in the space provided. This name will be shown as the Sender for all restored messages. You can also upload an image that would be shown as an avatar for all imported messages by clicking the Upload Image button. Click Create after you provide the name and the image.
  • recoverymanager-plus-webhook-configure

  • Save the provided URL.
  • microsoft-teams-connector-configuration

Converting the backup data into a .txt file

Once the Webhook has been created, the messages to be restored have to be converted to plain text (.txt) format.

There are many ways in which you can achieve this and you can use any of those methods. In this example, we’ll export the chat data to PST and convert the exported data to .txt.

To convert the messages of Edward Francis to .txt format,

  • Log in to RecoveryManager Plus as an administrator.
  • Navigate to Exchange tab → Restore.
  • Select Office 365 in the Exchange Type drop-down.
  • Select the Tenant which has Edward Francis’s account.
  • In the Select Backup drop-down box, select the schedule which contains Edward Francis’s backup.
  • Click on the Review and Restore link.
  • In the screen that appears, navigate to Conversation History → Team Chat in the left-pane.
  • Select all the items in that folder and click Export.
  • recoverymanager-plus-team-chat-export

  • In the pop-up that appears, provide a name for the export job and the path where the PST should be stored.
  • Click Export.
  • recoverymanager-plus-export-dialogue-box

  • Once you’ve exported the chat to PST, open it in Outlook.
  • microsoft-team-chat-personal-folders

  • Select all the files and download them as a .txt file.
  • microsofteam-chat-personal-folders-download

    The downloaded text file will resemble the following image.

    microsoft-team-chat-text-format

Once the messages are ready, they can now be imported back to Teams via PowerShell.

Importing text chats to Teams using PowerShell.

PowerShell is one of the many methods to forward data to Webhook. You can use other methods if you prefer them.

  • Open PowerShell.
  • Specify the address of the webhook URL that you had copied in step 1.
  • $uri=" https://outlook.office.com/webhook/93c0989e-d716-4d88-689,713eaf2a85fdOad4f883-51fe-47 c9-and-cfaa96415320/IncomingWebhook/d9bacd87cce9411d85d8d9b5f574e883/6d880497-5971-4244-9550-286d765ad887"
  • Specify the message that you want to restore to Teams.
  • $body = '{
    "text":"From: Edward Francis\n
    Sent: Friday, April 17, 2020 7:03 PM \n
    To: Marketing Analysis \n
    Please do ping your queries here if any \n
    "
    }'
    Note: The ‘\n’ symbol is a line breaker and if it's not used, the text will be sent in a single line.
  • Send the message to Teams with the following command.
  • Invoke-RestMethod -uri $uri -Method Post -body $body -ContentType 'application/json'

If PowerShell succeeded in sending the message via the Webhook, PowerShell will return ‘1’ as the result.

powershell-success-message

And you can see the message restored in Teams.

microsoft-teams-restored-channel

Restoring OneNote data

RecoveryManager Plus backs up both personal notes and SharePoint Team site notes. Unlike messages, they can be automatically restored and Teams will recognize them.

Personal Notes

Personal notes can be stored in the local disk or on the user’s OneDrive for Business account. If the notes are stored in the OneDrive for Business account, the notes are backed up as a part of the OneDrive for Business user account and can be restored when needed. When the note is restored, OneNote would detect that you've created new file and add it to the list of user's notes.

SharePoint Team site notes

SharePoint notes are created automatically when SharePoint Team sites are created. They are stored in default library called Site Assets. They are automatically backed up when SharePoint Online sites are backed up and when restored, OneNote detects the additions and adds it to the SharePoint Team site notes.

Conclusion

Although Microsoft does not provide an option to perform 1-click restoration of Teams data, there are a few alternate ways in which you can achieve that if you already have RecoveryManager Plus to back up your Exchange Online, SharePoint Online, and OneDrive for Business data. If and when Microsoft does allow third-party apps to restore directly to Teams, RecoveryManager Plus will also evolve to provide that.

Couldn't find the feature you wanted? Raise a feature request
Need a full-fledged demonstration of the product? Request a personalized demo

Need further assistance?

Fill this form, and we'll contact you rightaway.

Request Support

  •  
  • *
     
  • *
     
  • *
     
  • By submitting you agree to processing of personal data according to the Privacy Policy.

"Thank you for submitting your request.

Our technical support team will get in touch with you at the earliest."

A single pane of glass for Active Directory, Azure Active Directory,
Microsoft 365, Google Workspace, and Exchange Backup.
  • » Personal WorkDrive backup
  • » Backup retention
  • » Incremental backup