0

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?

4 Answers 4

0

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.

0

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?

0

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!

0

If you want to move your WP site from "subdirectory to subdomain" follow those steps

  1. Move your all resource from subdirectory to subdomain
  2. Make changes in database in *_options table (replace all subdirectory address to subdomain in those 2 fields)
option_name > home
option_name > siteurl

Replace value with your sub-domain value

  1. Not done yet, now you can access to your website from your sub-domain wordpress website login page. Still your website resource trying to load from subdirectory, so now you have to update you website database by replacing subdirectory to subdomain url. You can do it search in database and repalce them with your subdomain. It's little tricky one. Better is install a plugin "Better Search and Replace" to replace website's resource loading path from subdirectory to subdomain.

  2. Done!

Another way to migrate website easily is

  1. Install any migreation plugin (2. All in One WP migrationsm Duplicator, Updraftplus and other
  2. Take backup from current website (subdirectory)
  3. Move the backup from current subdirectory to subdomain
  4. Restore that backup into sub-domain (backup restore depend on which plugin your using to migrate)
  5. Done!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.