Syncing content from a WordPress site to another can sometimes be a challenge. While sites that don't change very often may be able to export their database and import it into the destination, WordPress sites with ever-changing content can get quite complex.
The complexities increase even further when working with WordPress Multisite networks. Not only can syncing an entire Multisite network become trickier as it grows, the sheer volume of data can increase drastically over time. That's where syncing a single site within a WordPress Multisite installation can be a life-saver.
In this article, we'll show you how to use the Pagely Sync tool to sync a single site within a WordPress Multisite installation to another.
Introduction to Pagely Sync
The Pagely Sync tool is a great way to synchronize content from one location to another. It's available by default of all Pagely account and can make one-time synchronizations a breeze with a single command.
Note: If you need to sync content regularly or perform more fine-grained migrations, take a look at the Pagely Clone Tool for a more configuration-based approach. These same options are also available there.
Basic Pagely Sync Usage Example
Before we get started with the WordPress Multisite-specific options, let's take a look at a basic example of syncing a production site over to a staging environment:
pagely sync ~/sites/example.com ~/sites/staging.example.com
As you can see in the example above, all you need to do is provide Pagely Sync with a source and a destination. It'll handle the rest.
Syncing a Specific Site From a WordPress Multisite Environment
To sync an individual site within a WordPress Multisite environment, the
--limit-to-multisite option can be used when running the Pagely Sync command. Here's an example:
pagely sync --rename --limit-to-multisite=3 ~/sites/source.example.com ~/sites/dest.example.com
In the example above, we're syncing the site with ID 3 from source.example.com to dest.example.com by adding
--limit-to-multisite=3 to the typical sync command.
Note: This option will sync the tables belonging to the blog ID specified as well as the main tables for the app. Please avoid using this mode if you do not want the main tables to be synced.
Within our example, we're also using the
--rename option. This is optional, but ensures that references to the source site's primary domain are replaced with the destination's.
Want to learn more about Pagely Sync? Take a look at our guide on cloning WordPress sites with Pagely Sync.