Comment on page
URLs in a Migration from WordPress to Frontity Decoupled Mode
If you are migrating an existing WordPress site to Frontity and you are using Decoupled Mode, you will need to change the URL of your WordPress site. You need to do this as the primary domain (i.e. the one that site visitors use) will point to the Frontity site, and the domain that points to the WordPress installation will need to be changed to the secondary domain (or subdomain).
Let's take as an example a WordPress site under the domain
www.domain.com. Let's suppose that we want to migrate this to Frontity in Decoupled Mode. We will need to make the following changes:
www.domain.comwill point to the Frontity server
wp.domain.comwill point to the WordPress server
In this scenario internal links that exist in the content when the WordPress URL is changed to
wp.domain.comwill still point to
www.domain.com. However, if any content is added after the change then internal links will point to
wp.domain.com. This creates a situation where internal links in the content are inconsistent, with "old" links pointing to
www.domain.comand "new" links pointing to
In addition, the link processor uses the domain configured as the WordPress data source (which will now be
wp.domain.com) to convert links to a
<Link />component. So if the internal links are left pointing to
www.domain.comthe link processor won't work on those links because it will only convert links pointing to
wp.domain.com, i.e. the URL of the WordPress data source.
Also, for the reasons stated above, any URLs in the content stored in the database also need to be updated to reflect the new domain (e.g.
wp.domain.com). This can be done in 2 ways:
- With a WordPress plugin
- Updating the URLs manually
To change the URLs in the content stored in the database you can use a plugin such as one of the following:
Before running the commands below ensure that you have a backup of your database!
UPDATE wp_options SET option_value = replace(option_value, 'https://www.domain.com', 'https://wp.domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'https://www.domain.com', 'https://wp.domain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'https://www.domain.com', 'https://wp.domain.com');