rewrite upgrade step