I'm been using this article as reference when I tested a migration of the Distribution database the last week. It is very good and informative, but it has some limitations. It probably works well with transactional replication, but lack some scripts for merge replication.
In order to make it working on my test enviroment using only merge replication with pull subscription from SQLexpress clients I had to update the publisher_id in the following tables:
I can now sync my clients again, and they did not have to download the snapshot again in order to make it work.