make the upgrade script directly runnable and check ROOT validity