Life Saving MySQL Queries to Change WordPress Website Domain in Database

Life Saving MySQL Queries to Change WordPress Website Domain in Database

Life-saving MySQL queries to Change WordPress Website Domain

Why and when you have to migrate WordPress site Database manaully by MySQL queries?

Well, there are many good duplicator tools and migration tools and cloning tools in the market to migrate WordPress websites. Many of them are free, some of them are premium and most of them work great. But there are some cases where we have to manually migrate the WordPress website to the new host. If your site is of large size and there are some servers in which migration tools are not working, then in these circumstances we have to migrate the WordPress site manually.

When you have to manually migrate a WordPress website from one domain to another or to another host, you have to perform some database queries to make the website work properly on the new domain and host.

WordPress Migration Query Generator

I have created a tool using which you can generate WordPress migration queries. this tool is a great time saver. Just generate the queries and run them in MySQL.

If you would like to generate a MySql query for a WordPress multisite site, then you can generate it from here.

Before running the MySql query in the database, remember to backup any database you are going to change. You have been warned!

Copy to clipboard

Query 1: update option_value into the wp_options table.

Query 2: update post_content into the wp_posts table.

Query 3: update post_excerpt into the wp_posts table.

Query 4: update meta_value into the wp_postmeta table.

Query 5: update meta_value into the wp_termmeta table.

Query 6: update comment_content into the wp_comments table.

Query 7: update comment_author_url into the wp_comments table.

Query 8: update guid into the wp_posts table.

Alternative Query 8 for migrations from localhost enviroments.

Need more detailed instructions? Check out the WordPress CODEX

I trust this post has been helpful, and now you’ve got a working migrated WordPress website to new host.

Share your love

Leave a Reply