This paper develops a dynamic model for cost-effective selection of sites for restoring biodiversity when habitat quality develops over time and is uncertain. A safety-first decision criterion is used for ensuring a minimum level of habitats, and this is formulated in a chance-constrained programming framework. The theoretical results show; (i) inclusion of quality growth reduces overall cost for achieving a future biodiversity target from relatively early establishment of habitats, but (ii) consideration of uncertainty in growth increases total cost and delays establishment, and (iii) cost-effective trading of habitat requires exchange rate between sites that varies over time. An empirical application to the red listed umbrella species – white-backed woodpecker – shows that the total cost of achieving habitat targets specified in the Swedish recovery plan is doubled if the target is to be achieved with high reliability, and that equilibrating price on a habitat trading market differs considerably between different quality growth combinations.