I think this handles the upgrade part.
Signed-off-by: Antes <antes@simplemachines.org>