When you rename a SharePoint site, Teams file search can stop returning results for files stored in that site. This happens because Teams caches the old site URL and does not automatically refresh it after the rename. This article explains the root cause and provides step-by-step fixes using the Teams admin center and SharePoint admin center.
You will learn how to clear cached paths, verify the new site URL, and re-index the site. The fixes apply to both classic and new Teams desktop clients.
Key Takeaways: Restore Teams File Search After a SharePoint Site Rename
- Teams admin center > Teams apps > Manage apps: Force a refresh of the Teams cache to pick up the renamed site URL.
- SharePoint admin center > Active sites: Verify the new site URL and confirm the site is not in read-only mode.
- SharePoint site settings > Search and offline availability: Re-index the site to rebuild the search catalog with the new path.
Why Teams File Search Breaks After a SharePoint Site Rename
When you rename a SharePoint site, the site’s URL changes. Teams stores a reference to the original URL in its local cache and in the search index. After the rename, Teams still points to the old URL, so search queries return no results for that site.
The search index is a separate service that crawls SharePoint content. The index keeps the old URL until it recrawls the site. A rename does not automatically trigger a recrawl. This is why the issue persists even after you clear the Teams cache.
Another factor is that Teams uses a unique site ID, not the URL, for internal operations. However, the search query uses the URL path. If the old path is gone, the search fails.
What the Site Rename Changes
A site rename changes the site’s primary URL. For example, https://contoso.sharepoint.com/sites/oldname becomes https://contoso.sharepoint.com/sites/newname. Any file links that were copied before the rename still point to the old URL. Teams file search relies on the indexed URL, so it cannot find files until the index is updated.
Steps to Fix Teams File Search After a SharePoint Site Rename
Follow these steps in order. The first two are the most common fixes. The third is needed if the issue persists.
Step 1: Clear the Teams Cache
- Close Teams completely
Right-click the Teams icon in the system tray and select Quit. Make sure no Teams process is running in Task Manager. - Delete the cache folder
Press Ctrl+R to open the Run dialog, type %appdata%\Microsoft\Teams, and press Enter. Delete the folders named Cache, Code Cache, and GPUCache. - Restart Teams
Launch Teams again. Sign in with your work account. The cache will rebuild with the new site URL.
Step 2: Verify the New Site URL in SharePoint Admin Center
- Open the SharePoint admin center
Go to admin.microsoft.com and select SharePoint from the left navigation. - Check the site list
Select Active sites. Find the renamed site. Confirm that the URL shows the new name and that the status is Ready. - Check site permissions
Click the site name, then select Permissions. Ensure your account has at least Read access. Without access, search will not return results.
Step 3: Re-index the SharePoint Site
- Open the site’s settings
Go to the renamed site URL directly in your browser. Select the gear icon and choose Site information. - Navigate to search settings
Select View all site settings. Under Search, click Search and offline availability. - Re-index the site
Click Reindex site. This queues the site for recrawling. The index update can take up to 24 hours.
Step 4: Force a Search Index Update via PowerShell
- Install the SharePoint Online Management Shell
Download it from the Microsoft website and install it. - Connect to SharePoint Online
Open PowerShell and run Connect-SPOService -Url https://contoso-admin.sharepoint.com. Sign in with your admin account. - Trigger a recrawl
Run Request-SPOPersonalSiteReindex for the site. This is a manual way to speed up the index update.
If Teams File Search Still Returns No Results
Teams Shows Old Site Name in the File Picker
If you still see the old site name in the file picker, the cache may not have cleared completely. Repeat Step 1 and also delete the IndexedDB folder in the Teams cache directory. This folder stores database files that can hold stale URL references.
Search Works on the Web but Not in Teams
This indicates the SharePoint index is fine, but Teams has a local issue. Sign out of Teams and sign back in. If that fails, uninstall Teams and reinstall the latest version. This resets all local state.
Files Are Missing from Search Results After Rename
If some files are missing, check if the files were moved during the rename. A rename does not move files, but a site move operation can. Use the SharePoint admin center to verify the site’s content is intact.
Teams File Search After Site Rename: Cache vs Index vs Reindex
| Item | Teams Cache | Search Index | Reindex |
|---|---|---|---|
| Purpose | Stores UI state and recent files | Stores searchable URL paths | Rebuilds the search catalog |
| Affected by rename | Yes, old URL cached | Yes, old URL indexed | Fixes the index |
| Fix method | Delete cache folder | Wait for recrawl or reindex | Request reindex in site settings |
| Time to take effect | Immediate after restart | Up to 24 hours | Up to 24 hours |
After applying these fixes, you can search for files in Teams again. Start by clearing the cache and verifying the new URL. If the issue persists, reindex the site and check permissions. For a long-term solution, consider setting up a search content source that automatically updates when a site is renamed.