Migrating Wordpress site from subdirectory to subdomain

I have attempted to move a Wordpress site from a subdirectory on my root domain to a subdomain.

I changed the site options in Wordpress settings > general first, and then copied over the contents from the subdirectory to the subdomain.

Nothing is available on the new subdomain, however. Is there a way to save this migration?

Topic migration Wordpress

Category Web


Having done this multiple times I find the easiest way is to create a new WordPress site and migrate to that instance using WP Migrate DB pro and the Multisite addon. Then copying the relevant uploads folder across.

You could also use the WordPress import/export tool.

This method means you don't have to worry about manually updating table entries.

If you are doing it manually, then you will need to update the home and site URLs, update the blogs table if running multisite, update your htaccess file, run a find/replace to update the domain name, update your hosts file to include the subdomain..

Good luck!


You need to move all files from sub directory to the directory where sub domain is pointed.

Then you need to make changes in database in *_options table. If you don't want to make changes in database then you should place below lines in your wp-config.php file.

define('WP_HOME', 'http://subdomain.example.com');
define('WP_SITEURL', 'http://subdomain.example.com');

Give it a try and let me know how that goes?


There is a very specific process to moving a WordPress site. You need to move the files and folders and change the rewrite block in .htaccess. But you also need to change URLs in the database.

See Moving WordPress « WordPress Codex and WordPress Serialized PHP Search Replace Tool.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.