Skip to main content

Trigger a Plugin Update or Activation

When Events Manager is updated, it runs an upgrade routine that creates or alters its database tables and adds new settings. Now and then that routine doesn't finish, for example when an update is interrupted or files are replaced by hand over SFTP. The usual signs are database errors that mention a missing em_ table or column, or new settings that don't appear.

You can make the routine run again. It is written to be repeated: it adds what is missing and leaves existing data alone.

Before you start

Back up your database first. You need an administrator account, or WP-CLI access.

How Events Manager decides to upgrade​

Events Manager stores the version it last installed in an option named dbem_version. When an administrator loads any page, it compares that value with the version of the plugin files. If the stored value is lower, it runs the upgrade routine and then updates the option.

So to trigger the routine, lower the stored version.

Run the upgrade again​

  1. Check the stored version:

    wp option get dbem_version
  2. Set it slightly lower than the value shown. If it is 7.5, use 7.4:

    wp option update dbem_version 7.4
  3. Log in to wp-admin as an administrator and load any page. The upgrade runs on that page load.

  4. Check that the value is back to the current version:

    wp option get dbem_version
caution

The options screen saves every option on the page, and a mistake there can break a site. Change only dbem_version.

Lower the number by a small step. A much older version number makes Events Manager run migration steps meant for sites upgrading from that version, which is slower and is not needed for this.

You don't need to deactivate and reactivate the plugin. Deactivating Events Manager doesn't delete its data, but it is an extra step that changes nothing here.

Multisite​

Run the steps on each site that shows the problem, since each site has its own dbem_version. With WP-CLI, add --url= with the site's address to each command. In global tables mode, start with the main site. A network administrator can also use Network Admin then Events Manager then Update Blogs to run the upgrade across the network.

Events Manager Pro​

Pro keeps its own version in the option em_pro_version and upgrades the same way. Lower it by a small step and load a wp-admin page as an administrator.

Test it​

Reload the screen that showed the error. If a table or column is still reported missing, turn on WP_DEBUG_LOG, repeat the steps, and read wp-content/debug.log. A database user without permission to create or alter tables is the most common cause, and your host can correct that.