LifterLMS Database Update Stuck? How to Finish It Safely

How LifterLMS database updates run in the background, how to tell whether one is really stuck, and how to get it moving again without losing data, using the updater log, cron and WP-CLI.

  • Add as a preferred source on Google
Illustration for “LifterLMS Database Update Stuck? How to Finish It Safely”

You updated LifterLMS and a notice says the database is being upgraded in the background. An hour later it still says that. Or the notice asking you to run the updater keeps coming back after you click the button. A LifterLMS database update that seems stuck is worrying, because it is the one part of an update that changes your data.

The good news is that the updater is built to stop and resume, and it records what it is doing. This guide explains how LifterLMS database updates work, how to check whether yours is really stuck, and how to get it to finish without deleting anything you should not.

It is written for site owners comfortable with the LifterLMS Status screens, and for developers with WP-CLI access.

How LifterLMS database updates work

Some LifterLMS releases need to change stored data as well as code: moving settings, adding columns, cleaning up old values. Each of these releases has a list of update tasks. When you install a new version, LifterLMS compares the database version it last recorded, stored in the lifterlms_db_version option, with the list, and queues every task newer than that version.

There are two kinds of update:

  • Automatic updates are queued and started straight away, with no notice. Every database update since LifterLMS 6.3, including the 10.2.0 update, is automatic.
  • Manual updates wait for an administrator. You see a notice reading "The LifterLMS database needs to be updated to the latest version." with a Run the Updater button. Clicking it asks you to confirm, with a strong recommendation to back up the database first. Sites upgrading from a version older than 6.0 will meet at least one of these.

Once started, the work happens in the background. While it runs you see "Your database is being upgraded in the background. Feel free to leave this page." When it finishes you see "The LifterLMS database update is complete."

What the background updater does

The updater processes its queue in short bursts. Each burst runs for about 20 seconds, or until PHP uses 90% of its memory limit, then saves its place and starts the next burst with a request from your server to itself (a loopback request to admin-ajax.php). As a safety net it also schedules a WP-Cron health check every five minutes that restarts processing if the chain of requests breaks. After the last task it records the new database version and shows the completion notice.

That design explains almost every stuck update: either the loopback requests fail and cron is not running, or one task keeps failing.

Is the update really stuck?

Large sites legitimately take a while. Before you intervene, check these:

  1. Compare versions. Open LifterLMS > Status, System Report tab. The Settings section shows both the LifterLMS version and the database version. If the database version has caught up, the update is finished and the notice may simply not have been cleared yet.
  2. Read the updater log. Updater logging is on by default. Open LifterLMS > Status > Logs and choose the log whose name starts with updater. You will see lines like "Queuing", "Running ... callback", "Finished ... callback" and finally "Update complete".
  3. Look at the times. New lines appearing every few seconds or minutes means it is working; leave it alone. No new lines for an hour means it has stopped.

The log also tells you how it stopped:

  • The last line is "Running some_task callback" with no matching "Finished" line: that task crashed. Go to The same task keeps failing below.
  • The last line is a "Finished" line, or "Unable to dispatch updater": the queue is fine but nothing restarted it. Go to Nothing is restarting the updater.
  • The log is empty: the update was never started. If you see a manual update notice, click Run the Updater; you need an account with the manage_options capability, normally an administrator.

Nothing is restarting the updater

This is the common case. The burst-and-restart chain depends on loopback requests and WP-Cron, and both are often broken on real sites.

  1. Check Site Health. Tools > Site Health reports failed loopback requests and late scheduled events.
  2. Remove what blocks loopback requests. HTTP basic authentication on the whole site, "coming soon" plugins that block admin-ajax.php, and firewall rules that block the server's own IP are the usual suspects.
  3. Make sure WP-Cron runs. If the System Report shows WP Cron as "No", a server cron job must call WordPress. Our guide to LifterLMS cron problems shows how to set one up.
  4. Nudge it. Loading any page in the dashboard can trigger WP-Cron. With WP-CLI you can run due events directly.

The WP-CLI checks below show the state of the updater. They only read data, apart from the last command, which runs due cron events, including the updater's health check:

# The database version LifterLMS last recorded, and the plugin version.
wp option get lifterlms_db_version
wp plugin get lifterlms --field=version

# Queued updater work (one row per saved batch).
wp option list --search="wp_llms_bg_updater_batch_*" --fields=option_name

# Is a burst running right now? This lock expires on its own after a minute.
wp transient get wp_llms_bg_updater_process_lock --network

# Is the health check scheduled?
wp cron event list --fields=hook,next_run_relative | grep llms_bg_updater

# Run whatever cron events are due.
wp cron event run --due-now

If batches exist, no lock is held and the health check runs, the update should move again within a few minutes. Watch the updater log to confirm.

The same task keeps failing

If one task crashes every time, the updater retries it on every burst and never gets past it. Find out why:

  1. Enable the PHP error log on the site if it is not already on, using WP_DEBUG_LOG as described in the WordPress debugging guide.
  2. Wait for the next burst, or run due cron events, then read wp-content/debug.log for a fatal error at that time.
  3. Common causes are the PHP memory limit or maximum execution time on a very large site, a database user without permission to alter tables, and another plugin hooked into something the task triggers.

Memory and time limits are the most common on sites with years of student data. Raise them for the duration of the update; our guide to LifterLMS memory limit and timeout errors covers how. If the error names another plugin, deactivate that plugin until the update finishes.

Some tasks change database tables. If the log shows a database permission error, ask your host to confirm the WordPress database user can create and alter tables.

What not to do

  • Do not delete updater batches to make the notice go away. When pending batches exist, a Delete processor batches tool appears under LifterLMS > Status > Tools & Utilities. It deletes the queued work of every LifterLMS background processor, including the database updater. The update then never finishes, the database version is never advanced, and the data changes it was making are left half done. Use it only on advice from LifterLMS support or a developer who has read the log.
  • Do not edit lifterlms_db_version by hand to skip an update. LifterLMS will believe the data is in a state it is not.
  • Do not roll back the plugin while an update is part-way through without a database backup from before it started. Older code may not understand partly updated data.
  • Do not run updates on production first. Copy the site to staging, update there, and time how long the database update takes. Then you know what to expect.

Preventing stuck updates next time

  • Run a real server cron job so the health check fires on time even on a quiet site.
  • Keep LifterLMS reasonably up to date. Skipping several major versions means several updates queue at once, including manual ones.
  • Back up the database, including the LifterLMS custom tables, before every LifterLMS update.
  • Update at a quiet time, and do not put the site behind basic authentication or a maintenance plugin that blocks admin-ajax.php while the update runs.
  • Test on staging with realistic data. A 30-second update on a demo site can take far longer with 50,000 students.

If you maintain several sites, our guide to customising LifterLMS without breaking updates covers the wider update routine.

Frequently asked questions

How long should a LifterLMS database update take?

Most automatic updates finish within a few minutes. Updates that touch every student or order can take longer on large sites. Progress in the updater log is the real measure.

Can students use the site while the database updates?

Yes. The update runs in the background and the site stays online. For large manual updates, a quiet period is still wise.

The update notice keeps coming back. Why?

Either the update never completes, so LifterLMS asks again, or a caching layer is serving an old copy of the admin page. Check the database version in the System Report and the updater log.

Where is the updater log?

Under LifterLMS > Status > Logs, in the file whose name starts with updater. LifterLMS stores its logs in the llms-logs folder inside your uploads directory.

What to do next

Read the updater log first. It tells you whether the update is working, waiting or failing, and which of the sections above applies. In most cases fixing loopback requests or cron is enough.

If the log shows a failing task, or the site has a lot of data and you cannot afford a long outage, our LifterLMS support team can complete the update safely, and our migration team handles upgrades from very old versions. Contact us with a copy of the updater log.

Add LifterLMS Expert to your preferred sources

Add lifterlmsexpert.com as a preferred source on Google, or open this article in your AI assistant to use it as a source.

  • Add as a preferred source on Google
Free consultation

Prefer expert help over DIY?

Skip the trial and error. Get specialist LifterLMS help and ship faster.

Talk to a LifterLMS Expert Explore our services

Replies within one business day