“I have renamed a channel in Teams, and now the files are gone, help!”
That was the reason why I am writing this blog post. To start with, the connection between the Files tab in Teams and SharePoint works like this: when you add a new Teams team and a channel, a SharePoint site collection will be added (unless of course you choose to add a team based on an existing site). They are then connected and you can see this by going to the “Files” tab in Teams. Let’s say you add a new Team that is called “O365Projects”. Now this will generate a site collection with the URL “https://yoursite.sharepoint.com/sites/O365projects”. On that site a folder will be added into the Documents library, and it’s called “General”:
That connected SharePoint folder is then displayed on the “Files” tab of your team in Teams and the files within it, the “General” folder in example here:
When you then add another channel in that same Teams group, let’s call it “Instructions”:
Then a new folder called “Instructions” will be added in the Documents library in SharePoint:
So what happens if someone either Rename or Delete these folders? Because they are connected now. I will describe four scenarios, what the effects are if you do any of the following actions. An important note: while I was testing this I did not close Teams in between and sometimes it looked like renaming worked, but when I restarted Teams it updated and then it was not working, so it may look like it works in Teams and that is just because it did not refresh properly so be sure to restart Teams when you rename or delete channels!v
Scenario 1: Rename a channel in Teams
If you click the three dots after a channel, and then select “Edit this channel” then you can rename the channel.
I changed the name to “Trainings”. The effect was that the channel was renamed, of course, but the folder in my SharePoint documents library did not change name – it was still called “Instructions”. But.. the connection still works. If I upload documents into either Teams or SharePoint to that channel, the files are visible on both places. But of course, this could end up in confusion when you go to the SharePoint site and look for documents connected to that channel and the name is totally different. Anyway, this works, but not recommended. The natural step would be to change the name in the document library to the same, what happens then? That is in our next scenario!
Scenario 2: Rename a folder connected to a channel in SharePoint
So we changed the name of our channel in Teams to “Trainings”. Now we want to change the folder name in the SharePoint document library to the same, to avoid confusion, right. Okey here we go, in SharePoint on the folder, click the vertical dots and select “Rename”:
Go back into Teams, what happens there? The Files area is emtpy! And the reference on Files is still pointing to “Instructions”. So that will break the connection. As you can see the channel is “Trainings” but it wants to find files in a folder called “Instructions”, so if you are uncertain on what folder the channel is connected to, then you will see that in the top of the Files tab in Teams (here the yellow mark is on the “Trainings” channel which is connected to the “Instructions” folder):
And now what happens in SharePoint is that it will automatically add back a new folder in the library called “Instructions”! So SharePoint will automatically match the channels, if they do not exist in there. Now I both have my new “Trainings” and the old “Instructions” folder. And this is where it could get confusing, because now you have a channel called “Trainings”, which points to the “Instructions” folder which is empty because your files are stored in the “Trainings” folder…. :
Recommended solution: Move the files out of the channel (example: move all files from “Instructions” folder) to a temporary folder in SharePoint. Then delete the channel and folder, and in Teams create a new channel with the name you want. Then move the files back from the temporary folder into that new channel’s folder.
Scenario 3: Delete a channel in Teams
Okey let’s delete a channel in Teams and see what happens in SharePoint. I will delete the channel “Trainings”. Note the message that the files will still be available (it means now on SharePoint) and you can copy that link to go to the connected folder:
And yes, after deletion the folder is still on SharePoint. So that worked. What if I then want to restore the channel? You will find it on the Teams settings tab and Channels, there is section called “Deleted”. Choose to restore the channel there:
That worked because the connected folder was still on SharePoint.
What if we had deleted the folder in SharePoint also, and tried to restore the channel? Then it will restore the channel, and as soon as you click on the “Files” tab it will add back that folder to the library on SharePoint BUT the folder is… EMPTY!! So your files are gone! Teams will not restore your files. I looked in the recycle bin on SharePoint and you can restore the files from there, but it gets stuck on Restoring so not sure that will work. You cannot access the files inside folders from the recycle bin, so that may not work.
Recommended solution: For governance and traceability, do not delete the folders from SharePoint! Then you know you can always restore a channel after it is deleted and the channel will connect back to the original folder.
Scenario 4: Delete a folder connected to a channel in SharePoint
Let’s find out what happens if you delete a channel folder from SharePoint while the channel is still in Teams. I deleted the folder “Presentations” in SharePoint:
Went into Teams and the Files tab and it is empty, as expected:
Go back into SharePoint to find a new folder added called “Presentations”. So SharePoint will add a new folder automatically. What if we want to restore the deleted folder and files then? We did delete this by mistake! Well, that restore does not seem to work, it is stuck on “Restoring”.. So these files are probably gone!
Scenario 5: Delete a channel and add a new with the same name
What if we delete a channel in Teams, the folder and files are still available in SharePoint, and then we do not use the “Restore” but instead try to add a new channel with the same name? That will not be possible, and you will get a message saying that the channel name is already taken: