Issue #2548725 by pwolanin, catch, dawehner, mradcliffe: Fix regression to menu serialization in upgrade path that causes thousands of errors in PostgreSQL