[enh] Make upgrade script standalone