updated upgrade script to use mongo or redis