Make sure that all changes from the master have already been replicated.
If you can, back up the master using binary copy so that you do not lose any changes.
Demote the master replica to a hub replica.
Wait for the hub to start replicating to other servers.
When the hub opens a replication session to the other servers in the topology, it remains in the RUV but is no longer used in referrals.
Stop the hub.
Remove the hub from the topology.