I think you need to use the -r option there too. Try:
$LJHOME/bin/upgrading/update-db.pl -r -p
Also, can you post the content of bin/upgrading/text.dat (and text-local.dat, if also using dw-nonfree), and the settings for @LJ::LANGS and $LJ::DEFAULT_LANG (if present) in $LJHOME/etc/config*.pl? That may help troubleshoot the "Unable to load language code: en_DW" error message.
no subject