I have been trying to test that changing the value of the merge replication subscription expiration from 7 to 21 days will function correctly. It certainly seems like it works fine, and I’ve updated our refresh snapshot job to account for the added days too. There is a subscriber with a pull subscription that merges every 5 minutes.
My issue is that I want to force a subscriber to be expired and then resubscribe it and verify it works. No matter what I do, it does not seem to expire. The general steps I have tried to force the expiration is as follows (NOTE: I’m using the 7 day expiration just to see if I can get the subscriber to expire):
Ensure there is a valid publication and a pull subscriber.
Stop any subscriber merges by stopping the tool that performs that merge.
On the publisher computer, make a change to a published table article. This is done after the last subscriber merge.
Update the date of the server to 30 days in the future.
Restart the SQL Server service (also restarts the SQL Server Agent).
On the publisher, clean metadata using exec sp_mergemetadataretentioncleanup.
Run the following jobs on the publisher:
Agent history clean up: distribution
Distribution clean up: distribution
Expired subscription clean up
Refresh the snapshot (sp_startpublication_snapshot).
Update the subscriber’s computer to the same date as the publisher.
On the subscriber’s computer, restart the SQL Server service.
Perform a merge replication.
With all of this done, it continues. I would have expected the subscription to be expired being that the metadata should be gone (BTW - MSmerge_genhistory still shows the older data). I’ve even tried rearranging the cleanups and refreshing snapshot to no avail. Sometimes it just syncs, other times it seems to automatically reinitialize when I didn’t tell it to.
Can anyone help? Thanks.