Get the Best WordPress Backup
& Migration Plugin Today
Get Duplicator Now
Announcement Duplicator WP-CLI commands

Announcing Duplicator WP-CLI Commands (And How They Speed Up Backups)

Looking for a smarter way to manage site backups? Explore Duplicator's new features, including customizable WP-CLI commands and permission settings!
How to update WordPress database

How to Update Your WordPress Database (+ Fix the Update Required Loop) 

Written By: author avatar Joella Dunn
author avatar Joella Dunn
Joella is a writer with years of experience in WordPress. At Duplicator, she specializes in site maintenance — from basic backups to large-scale migrations. Her ultimate goal is to make sure your WordPress website is safe and ready for growth.
     Reviewed By: reviewer avatar John Turner
reviewer avatar John Turner
John Turner is the President of Duplicator. He has over 20+ years of business and development experience and his plugins have been downloaded over 25 million times.

Keeping your WordPress database up-to-date keeps your site healthy and secure.

Your database stores all the content, settings, and user information for your website. An outdated database can lead to WordPress security vulnerabilities, compatibility issues, and performance problems.

In this complete guide, I’ll show you how to update your WordPress database! Let’s get started.

Table of Contents

Why You Need to Update Your WordPress Database

The WordPress core software has frequent updates that include important database changes and improvements. These database updates keep your site secure, add new features, and maintain compatibility with the latest WordPress versions.

Before Updating Your WordPress Database

Before you update your WordPress database, create a full backup of your site. This includes your database, files, and any other important data.

Having a recent, reliable backup will allow you to easily restore your site if anything goes wrong during the update process.

To do this, I’d recommend using Duplicator. Unlike other backup plugins, it can get your website back to normal even if it’s completely offline.

Duplicator Pro plugin

Plus, Duplicator has advanced WordPress features including:

  • Support for WordPress multisite
  • Easy migrations to a new host, domain, or staging environment
  • One-click restores
  • Remote restores from the cloud
  • Cloud storage
  • Support for large websites
  • And more!

With Duplicator, create a new backup. If you’d like extra protection, choose a cloud storage location.

Duplicator backup first step

In the Backup section, choose the Full Site preset. You could also back up just the database, but a full-site backup will roll back any errors.

Full site backup preset

Hit Continue. Duplicator will scan your website. Review any notices before creating the backup.

Duplicator backup scan

Just in case anything goes wrong, it’s a good idea to set this backup as the disaster recovery point. Click on the blue house icon.

Disaster recovery icon

Once you set disaster recovery, you’ll get two different ways to restore your site. Either copy the recovery link or download the launcher file.

Disaster recovery options

If you get completely locked out of your admin dashboard, paste the recovery link into a browser window. Or, open the launcher file. Duplicator will automatically restore this backup you just created.

How to Update Your WordPress Database

Usually, upgrading WordPress databases is an easy process. Start by updating your website to the latest version of WordPress. You can do this on the Updates page.

Update WordPress version

If your database also needs updating, a notice will pop up. Click on Update WordPress Database.

Update WordPress database

To check if there’s an independent database update, visit yourdomain.com/wp-admin/upgrade.php

Be sure to update this with your site URL. WordPress will tell you if your database is up to date.

No database update required

How to Fix the WordPress Database Update Required Loop

When you update your WordPress database, you might get stuck in a “database update required” loop. This happens when WordPress detects that your database needs an update, but for some reason, the update process doesn’t complete successfully.

If this error happens, WordPress will continually prompt you to update the database on every page load, creating an endless loop.

Let’s start by checking that the db_version value in your database is the same in the version.php file.

In cPanel, open Databases » phpMyAdmin. Select your database and click on the wp_options table. Write down the option_value for the db_version.

Database version option value

Next, open your site files. Go to the wp-include directory and find the version.php file. In this file, you should see a line like this:

$wp_db_version = 57155;

Make sure these values are the same. You may need to update your version.php file.

Another way to fix this error is to find the object-cache.php file in your wp-content directory. Delete or rename this file.

How to Update Your WordPress Database Configuration

You may also need to update the WordPress database connection details in your site’s configuration file (wp-config.php). This file contains the credentials and settings needed for WordPress to connect to your database.

The wp-config.php file is located in the root directory of your WordPress installation. Inside this file, you’ll find the following database connection details:

  • DB_NAME: The name of your WordPress database
  • DB_USER: The username used to access your WordPress database
  • DB_PASSWORD: The password used to access your WordPress database
  • DB_HOST: The host or server where your WordPress database is located

These values can change if you’ve migrated your site to a new host or server. You’ll need to update your WordPress database after migrations.

It’s important to be very careful when modifying the wp-config.php file, as a single typo can prevent your site from connecting to the database. Always make a backup of your wp-config.php file before making any changes.

To check your WordPress database configuration settings, open phpMyAdmin. Select your database.

Check the first part of the table names to get your database prefix. This will most likely be wp_.

WP database prefix

Head back to the Databases section and click on MySQL Databases.

MySQL databases

Find your current database. Note the username and password for it.

Now you can open your wp-config.php file. Edit the database name, user, and password with the information you just discovered.

Set the DB_Host to localhost. Add your table prefix as well.

After this, save the file.

If you’re unsure about how to correctly update the database configuration, it’s best to consult with your hosting provider or a WordPress developer. Improperly configuring your database connection can lead to serious issues with your site.

Frequently Asked Questions (FAQs)

How do I access my WordPress database?

You can access your WordPress database with a tool like phpMyAdmin. This database manager is often provided by your web hosting provider. phpMyAdmin allows you to view and manage all the tables and data in your WordPress database.

Where are WordPress database settings?

The database connection details for your WordPress website are stored in the wp-config.php file, located in the root directory of your WordPress installation. This file contains the essential credentials needed for WordPress to connect to your database, including the database name, username, password, and host.

How do I check my WordPress database version?

To check if you need to update your WordPress database version, go to yourdomain.com/wp-admin/upgrade.php. If there is an available update, WordPress will prompt you to install it.

How do I reset my WordPress database?

To reset your WordPress database, check to see if you have a database backup with the functionality you’re looking for. A plugin like Duplicator will keep a full log of your backups. If you find the right one, restore it.

Restore database backup

If you need to completely reset it to the default settings, you can use a plugin like WP Reset.

Resetting your WordPress database should always be done with extreme caution, as it will erase all of your site’s content, settings, and user data. Only attempt a database reset if you have a complete backup of your site that you can restore from.

Can you restore the WordPress database?

Yes, you can restore your WordPress database from a backup. Once you have a database backup, Duplicator will give you easy-to-use Restore buttons next to it.

Conclusion

Regular WordPress database maintenance is a small investment of time that can prevent a lot of headaches down the road. Stay on top of your database updates, and your WordPress site will continue running smoothly for years to come!

While you’re here, I think you’ll like these extra WordPress guides:

Do you want to easily restore your database after a bad update? Upgrade to Duplicator Pro for automatic WordPress backups and one-click restores!

author avatar
Joella Dunn Content Writer
Joella is a writer with years of experience in WordPress. At Duplicator, she specializes in site maintenance — from basic backups to large-scale migrations. Her ultimate goal is to make sure your WordPress website is safe and ready for growth.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. We only recommend products that we believe will add value to our readers.