replaceNames and upgradeSchema