brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: wp core update-db finishes a WordPress update the dashboard is waiting for

WordPress
~/tips/tip-wordpress-core-update-db-dry-run

wp core update-db --dry-run

Runs the database upgrade step after new core files, with a dry run to check first.

When WordPress files are updated by hand, by Git or by a container image, the database stays on the old schema until someone visits the admin and clicks the button.

Check first, then run it:

wp core update-db --dry-run
wp core update-db

The dry run compares the database version with what the files expect and tells you whether an update is needed, without changing anything. The real run applies the schema changes and stores the new db_version. Afterwards the “Database update required” screen is gone.

On a multisite network, every site has its own tables. wp core update-db --network upgrades all of them in one go. Without --network you only do the main site, and the others keep nagging their admins.

I’d put this right after the file update in deploy scripts, so the two never drift apart. The command is quick on small sites. A major release can change large tables, though, and then it takes a while. Run it with a fresh database export at hand, because the schema change has no undo button, and going back to older files after the upgrade leaves you with a database that is newer than the code.

Further reading: wp core update-db

More WordPress tips wp user application-password create anna backup-script --porcelain define( 'MEDIA_TRASH', true ); wp cli check-update wp theme delete --all wp media image-size All WordPress tips (85) All topics

Link