Skip to content
r-a-y edited this page Aug 14, 2020 · 4 revisions

Version 3.9.0 of BPGES introduced a new database schema for storing subscriptions and queued items. This change allows queued items to be sent in "batches", in an asynchronous fashion, which in turn eliminates most problems with scaling BPGES.

When upgrading to 3.9, BPGES will attempt to make the following changes:

  1. Create two new database tables: wp_bpges_subscriptions and wp_bpges_queued_items
  2. Migrate all existing subscriptions from their legacy location (serialized arrays in BP's groupmeta tables) to the new wp_bpges_subscriptions table
  3. Migrate all existing queued digest items from their legacy location (serialized arrays in usermeta) to the new wp_bpges_queued_items table

Database table creation ought to happen immediately after upgrading the plugin. Data migration happens via a background asynchronous process. Subscriptions are processed in batches of 10 groups at a time, and digest items are migrated 50 users per batch. On large sites, it may take several minutes for this process to complete.

While the migration process is unfinished, an admin notice will display on the Dashboard informing you of this fact. On the BPGES settings panel, sites with unfinished migrations will see a "Migration Status" section, indicating which steps have failed, which are in progress, and which have completed. Once the migration is complete, this section of the settings panel will no longer appear.

If the migration is stuck or broken, you can use the link in this Migration Status section to restart the process.

There are also a number of WP-CLI migration tools built into the plugin, which may be useful to administrators with command-line access:

  • wp bpges install-database installs the custom database tables
  • wp bpges migrate-legacy-subscriptions triggers the migration of group-user subscriptions
  • wp bpges migrate-legacy-digest-queue triggers the migration of old digest items

If WP-CLI is unavailable, the following script may be used to force the migration in a single pageload. On large installations, this operation may timeout, but can be run repeatedly until the migration is complete.

  1. Put the following script into a mu-plugin (/wp-content/mu-plugins/): https://gist.github.com/boonebgorges/14c0d1042e85d263d48f3eaf7ca25b6d
  2. As an admin, visit wp-admin/?bpges-force-migrate=subscriptions to migrate subscriptions, or wp-admin/?bpges-force-migrate=queued_items to migrate queued items.
Clone this wiki locally