CRM-13970 - Fix upgrade script