We may have to update old URLs in the database when following situations occurs
- Moving from HTTP to HTTPS
- Migrate a WordPress site to a new web server
- Moving the website from one domain to another on the same web server
- Change WordPress directories on existing server
If your are looking for a quick solution for above matters, then you can try Better Search Replace plugin.
In this tutorial, we will show you how to set https in WordPress, so you can connect to your website securely over SSL
STEP 1 : Create a complete WordPress backup before making any changes to your WordPress database. In case something goes wrong, you can go back to the working version.
STEP 2 : Login to the WordPress Dashboard and change the WordPress Address (URL) and
Site Address (URL)
STEP 3 : Login to the WordPress Dashboard and install Better Search Replace plugin
STEP 4 : After activating the plugin, go to Tools > Better Search Replace page. In Search for field add url with http and Replace with filed add your website URL with https .
Select all tables by holding shift and clicking end button or down arrow key
Untick Run as dry run and click Run search/Replace button
Thats all. You have successfully moved your WordPress to https
Here is a video tutorial to help you understand better: