fix broken features in upgrade command

check for text not JSON in lockfiles