How to update WordPress DB

In case you change from staging site to live site, the site URL in the database is pointing to a different site URL value, this results in your website could not access. The below method shows you how to access the database and edit the record via the command line.

At first, you need to have access to the database via the command line, and at least you need to know your database username and password.

  1. login to your database instance
mysql -u username -p
  1. Switch to your database
show databases;
use wordpressdb;
  1. Change the value on table wp_options values of option_id 1 and 2
SELECT option_name, option_value FROM wp_options where option_id=1
SELECT option_name, option_value FROM wp_options where option_id=2

Update the values

UPDATE wp_options SET option_value = "http://yourstie.url" WHERE option_id=1
UPDATE wp_options SET option_value = "http://yourstie.url" WHERE option_id=2

after gaining access to the system, then use elementor > Tools > Replace URL to replace the old URL to the most updated one.

Leave a Reply

Your email address will not be published.