We're running snapshots from a 2016 to a 2019 SQL Server.

I've looked through Microsoft's documentation and I'm not seeing a clear cut way to have this, and I'm not seeing any jobs on the Publisher/Subscriber that would run this sort of cleanup.

We recently had a drive fill up and I want to make sure to get this sorted out if it's a native feature of replication, otherwise I'm going to run a PowerShell script to take care of it.

2 Answers 2


set the retention period on the publication also see the link below ( this is the replication escalation engineers blog site - so a great resource ) for a slight gotcha.



For some reason, even after re-initializing the replication job with suggestions, the job would not clean up after itself. If anyone reads this and needs another solution, I ended up using PowerShell in a SQL Agent job to clean up the replication folder.

Remove-Item -Path "H:\ReplData\unc\<folder_name>\*" -Recurse

This will remove anything under the main replication folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.