Scheduling migrations with WP cron

In version 1.12.0 of WP Synchro, we introduced scheduled migrations via WordPress cron, which is part of WordPress core. This makes it possible to schedule migrations directly in the plugin without depending on a hosting-level cron system. WP Synchro already supports running migrations with a WP-CLI command from the command line, but that requires WP-CLI to be installed and, if scheduling is needed, some knowledge of the native Linux cron system.

We therefore introduced scheduled migrations, which are configured within the migration itself and can be set to run repeatedly without user interaction. It also does not require any setup at the server or hosting level. The primary downside to using WP-Cron is that it depends on traffic reaching the site in order to be triggered, which makes scheduling a bit less precise. So if the site has traffic, you have to accept that the migration will run as soon as possible rather than at an exact time.

Let's look at how to set it up.

How to set up scheduling for site migration

Scheduled migration configuration

Migrations are scheduled as part of the normal migration configuration when a migration is added or edited. This means that you can choose whether you want the migration to run automatically and at which interval. In the first release, only a few intervals can be selected. More complex scheduling options may be added later.

If you want to add scheduling to an existing migration, edit it and find the scheduled migration section.

After you have configured a migration to run on a schedule, you will want to monitor it to see its status.

How to monitor the scheduled migrations

Scheduled migration screen in WP Synchro

When a migration is scheduled, it runs in the background. Because of that, it can be difficult to see its status.

On your site, navigate to WP Admin, go to "WP Synchro" > "Scheduled migrations" menu and see the overview of scheduled migrations.

Still using free version? - Upgrade to PRO with 14 day free trial

PRO version makes it possible for you to migrate files between your sites and to automatically make a database backup before migration.
You will get support for Basic Authentication and email notifications on success or failure. You also get access to priority support