upgrade_settlement <settlement name>

Works fine. Do that twice and even though my building is still a castle I get access to the fortress level upgrades,