How can I upgrade when the Updater complains that it ran out of shared memory?

The Updater sometimes can't run to completion with the following complaint: ERROR: 53200 out of shared memory. This is common when jumping from one major xTuple ERP release to the next, particularly when upgrading to version 5.0.0 from earlier releases. It's related to the amount of data we need to migrate from older database structures to new ones.

The solution that has worked consistently is to increase the PostgreSQL configuration option max_locks_per_transaction. The minimum value to use depends on the size of your database and the size of the particular tables being updated. Our recommendation is to try the upgrade with your current configuration. Only if it fails with a memory error:

  • Make a note of the current value of max_locks_per_transaction
  • If it's less than 128, double it; otherwise add 64 to the current value
  • Restart your database server
  • Run the upgrade again
  • Repeat until the upgrade succeeds
  • Restore max_locks_per_transaction to the initial value you noted earlier
  • Restart the database server

And you should be good to go.