I have a Wordpress blog (blog.xxx.com). I have a nuxt personal website yyy.com which is hosted on aws.
Now I wish to map or migrate the Wordpress blog (blog.xxx.com)
If I understood your question correctly, you want to move your WordPress installation from blog.xxx.com
to yyy.com/blog
, right?
There is an official guide for this provided by WordPress: https://wordpress.org/support/article/moving-wordpress/
After you have changed the siteurl
and home
fields in table wp_options
of your database to yyy.com/blog
, you can use a plugin like Better Search Replace (https://wordpress.org/plugins/better-search-replace/) that scans your WordPress database and replaces every URL of posts etc. with the new URL of your blog.
In addition, in case of an Apache webserver you need to take care of the .htaccess
file and change the RewriteBase
to /blog
(assuming that it was /
before).
Some special plugins (for caching etc.) need some special treatment, but often clearing the cache solves the problem.
Yes, you can set up a WP site in a subfolder of your main website. I don't recommend doing it manually, too much can go wrong. Use a plugin such as Duplicator - it's so simple to use:
yyy.com/blog
)https://www.yyy.com/blog
That's it!
You can have the entire site set up & running perfectly in just minutes! it will even set up .htaccess
correctly.
No more setting up the database, changing urls in the database, 404 errors, broken links, broken images, etc. Moving a Wordpress site manually can be tricky and you can waste hours trying to fix the issues. Even agencies use a plugin to avoid the problems.
Well despite Johannes is perfectly clear for me, i'll try to simplify.
Clone WordPress files from blog.xxx.com to yyy.com/blog directory. (not sure how your server is configured, but probably you'll be able to access it.)
Clone Database to new server.
Run sql replace queries
UPDATE wp_options SET option_value = replace(option_value, 'https://blog.xxx.com', 'https://yyy.com/blog') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'https://blog.xxx.com','https://yyy.com/blog');
UPDATE wp_posts SET post_content = replace(post_content, 'https://blog.xxx.com', 'https://yyy.com/blog');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'https://blog.xxx.com','https://yyy.com/blog');
update your wp-config.php to match your new database.
login to yyy.com/blog/wp-admin
go to settings and update your permalinks