How to update all XO promotions after a Blueprint change in SDL Web 8.5 and earlier versions

The article below shows how to, in a quasi-automatic fashion, update all relevant Experience Optimization Promotions when a new Publication is added in the BluePrint. Read the full text.