Forward-port 3.1.0 upgrade script