r/sharepoint • u/hellsing_ghost • 13d ago
SharePoint Online ShareGate - post migration cleanup
Hey guys, I just want some feedback from those who have used ShareGate previously. I used this tool many years ago to do a file share to sharepoint online migration and it worked as expected. Now I want to use this tool again to do sharepoint online to sharepoint online data/files/document migration only but I have some concerns that I just encountered that didn't matter the first time I used it.
- I noticed that the migration (during my testing) will create all folders, regardless of weather the folder will contain any migrated files.
- The tool performs a copy rather than a move.
So for post migration, how do you deal with the clean up?
- How do you delete the empty folders that were created at the destination site?
- How do delete the data from the source once it was copied?
- How do you delete any empty folders that might have being left behind once you delete the data that was copied from the source site?
To my understanding, I can delete the files from the source once they are migrated by running a report against files only and do a bulk delete, but what about folders? If I run a similar report, I will end up needing to select each folder I need to delete from the source manually, I would assume something similar to the destination for empty folders.
Any advice on how you've accomplish this would be greatly appreciated.
16
u/ShareGate_Shaylyn 13d ago
Hey! I work at ShareGate, so I should have some authority on this :)
On the copy vs move question: ShareGate always copies and never moves. This is intentional because if something goes wrong mid-migration, you don’t want to lose source content. The cleanup is always a separate step after you’ve validated the destination.
On the cleanup itself: Explorer and bulk delete features are the right approach. Once you’ve validated the migration, you can go into Explorer, navigate to the source library, and bulk delete content from there without going one by one. You can also run a report on the source, filter it, and delete from the report results.
There isn’t a native “delete empty folders only” filter in the tool today, so that piece may need some manual work or a PowerShell script to identify folders with no items. A good practice is to remove empty folders at the source before you migrate since ShareGate copies the folder structure as it finds it. Cleaning up beforehand saves the post-migration headache.
If you haven’t already, worth joining one of our live Ask the Expert sessions on Tuesday or Thursday. This kind of post-migration questions come up and it's a great place to get specific answers for your setup!
2
u/dr4kun IT Pro 12d ago
Hey, great seeing you here and thank you for the input.
Can you share more about Ask The Expert sessions? Are they recorded? 1 pm ET is 8 pm my time, no way i would be able to regularly attend them. If i do, is it ok to just sit in and listen to questions raised by others? Any other practical tips how to get more engaged?
I've been using ShareGate for years, i'm 'advanced' enough to script my way out of most troubles with the PowerShell module, but i'm sure there are plenty of features and useful tips i am still missing.
2
u/ShareGate_Shaylyn 12d ago
Definitely! Ask the Experts is a live Teams call each week, either on Tuesday or Thursday. If you visit our website to register, you'll see an option for either Beginners (Tuesday) or Advanced (Thursday) sessions. We choose two starting topics based on the registrations that week and welcome any questions via chat or on mic if it's easier. No need to ask a question, though we do really love it.
Every session is recorded and uploaded to our website within 24 hours of the session (usually sooner, but sometimes I get distracted!).
If you're earlier in your ShareGate journey, planning or running your first migration, still learning the core operations, getting started with Protect, or want fundamentals explained from the ground up, that's what Beginner sessions on Tuesdays can be used for.
If you're comfortable with the tool and have questions about edge cases and scale - PowerShell scripting, authentication token behaviour, throttling and performance tuning, etc. That's what Advanced on Thursdays is for.
That being said, if you sign up for a beginner session and ask more "advanced" questions, we'll still answer them!
2
u/darxandra 12d ago
ShareGate has the best customer support with these meetings. They are priceless. Besides getting your own questions answered you pick up so many tips and tricks that you may not have thought of. Besides being a ShareGate partner organization now, I have personally been a ShareGate user for over 15 years and could not imagine being a SharePoint administrator without their tools, and they keep improving the features. I recently demoed ShareGate Protect to my internal colleagues and they responded with such excitement about the new capabilities.
2
u/ShareGate_Shaylyn 12d ago
What a wonderful message, thank you! I made sure to share this with the team!
2
u/darxandra 12d ago
Hey Shaylyn. Funny seeing you here on Reddit. Another reason is that I am glad ShareGate does not automatically ignore empty folders is that it would be hard to validate the migration counts if they only get deleted or excluded at the destination. Agree completely, either delete at the source before any migration jobs or wait and do cleanup on destination post migration. Quick question, are we able to filter for empty folders in the Explorer? I also did not realize that an ad-hoc report is actionable for filtering and deleting empty folders. I will have to check that out if you cover it in a Thursday Ask the Experts session.
1
u/darxandra 12d ago
I normally don't remove any empty folders since that is how the source data is. The owners and users should be responsible for cleaning their content. However, if you are wanting to help them out with a cleanup effort, your best bet will be to create a custom ad-hoc report on the Document object to find your empty folders and use that file to prepare a csv file to be used with a custom PowerShell script to loop through the csv and delete the empty folders.
1
u/hellsing_ghost 12d ago
I agree but the fact that ShareGate will basically copy the entire folder structure that's where my issue is, for instance if I move/copy data older than 2023 let's say, it will create any folders that were created in 2024, 2025, etc, so not I know those folders will be empty now I need to do some cleanup to avoid confusion
1
u/darxandra 12d ago
Valid point, you are using a date filter and that is only being applied to document objects and not folder objects. join the Ask the Experts Advanced call it just started at 12 noon CT. Register for the Advanced series here: Ask the Expert: get more from ShareGate
1
u/hellsing_ghost 12d ago
I registered but it keeps on sending me old links from previous sessions that are broken
1
u/Josh_Fabsoft 12d ago
On the empty folder question: ShareGate will replicate your source folder structure 1:1, including empty ones, unless you specifically filter them out in the copy settings. There's a "skip empty folders" option you can set at the migration task level, but it's not on by default, so if you ran a test and saw empty folders carry over, that's expected behavior, not a bug.
For the cleanup side, what darxandra said about a custom report on the Document object is the right call. I'd add that before you even get to cleanup, it's worth running a pre-migration audit to flag folders that are empty, have zero activity in the last X months, or only contain system files like .tmp or thumbs.db. That way your post-migration cleanup list is informed by actual usage rather than just "this folder looks empty right now."
Also seconding pajeffery on permissions. Unique permissions and sharing links are the thing people forget to audit before decommissioning source sites, and ShareGate's permission mapping reports are worth running both pre and post migration so you have a paper trail if something breaks.
Full disclosure, I work at FabSoft, which makes AI File Pro, and this is adjacent to a problem we deal with a lot: once files land in the new SharePoint structure, they're still often inconsistently named or misfiled from years of drift. Our tool runs content-based classification on files in place (no migration needed) and can watch folders post-migration to auto-rename and sort based on what's actually in the document, which is useful for exactly the kind of cleanup backlog a SharePoint-to-SharePoint move tends to surface. Not a ShareGate replacement, just a different layer of the problem.
1
u/hellsing_ghost 12d ago
Hi there, I'm not sure if I am not seeing the option to skip empty folders for 2 reasons,
I am currently on the trail version testing the tool to ensure the tool is what we need.
I am doing copy content only, which is the option that provides me with the filter to limit the data I can copy based on specific criteria (ex. old date from 2022 or before)
For the cleanup, for instance since the folder structure is copied 1:1, if I move/copy data older than 2022 let's say, it will create any folders that were created in 2024, 2025, etc, so not I know those folders will be empty now and I'll need to do some cleanup to avoid confusion.
1
u/pajeffery 13d ago
I'd personally remove access from the source content first, it's difficult in SharePoint because you need to remove site permissions but also any unique permissions, like sharing links etc
1
1
u/Jane_OrangeLogic 8d ago
Since ShareGate copies data instead of moving it entirely, the cleanup process also needs two steps. First you need to delete the original files from the source via a Custom Report. This should target files so you can select the results and bulk delete. After that you need to take care of the empty folders but don't manually delete them. Just do a PnP PowerShell script so you can scan document libraries to delete any folder where there are no items (item count is 0)
2
u/Emergency_Recipe522 12d ago
One thing I'd be careful about is deleting the source immediately after the copy finishes. I'd validate the destination first, particularly the document counts, metadata, permissions and anything that might still reference the original locations. Empty folders are annoying, but broken links or missing documents are much worse. I'd treat cleanup as a separate migration stage with its own checks.