You're right, I had a paragraph is on getting the number but this is obviously thin ice, so I dropped it for now. I'm out of ideas on how to measure it, I probably would ask a group of developers, let them make an educated estimation and then make a best effort estimation based on their answers, perhaps something like the Delphi Method [1]
"OTOH, the cost to migrate can never be greater than the cost to rewrite from scratch, since rewriting from scratch is a method of migrating."
Interesting point. I need to work on the definitions as obviously 'migration' is not clear cut enough.
[1] https://en.wikipedia.org/wiki/Delphi_method