Scheduling migrations with WP cron
In version 1.12.0 of WP Synchro we introduced scheduled migrations via WordPress cron (part of WordPress core), as a way of scheduling migrations directly in the plugin, without having a dependency to a hosting cron system. WP Synchro already support running migrations with a WP CLI command on the commandline, but it requires WP CLI to be installed and if scheduling is required, knowledge about native linux cron system is required.
Therefore we introduced scheduled migrations, which is configured within the migration, allowing it to be set run recurring without user interaction. Also, it doesnt require any setup on the server/hosting level. The primary downside to using WP Cron is that it requires traffic on the site to be triggered and that makes the scheduling a bit wonky. So if the site has traffic, you have to accept the fact the the migration will run 'best as possible' and as fast as possible.
Lets check out how to set it up.
How to set up scheduling for site migration
Migrations are scheduled as part of the normal configuration of migrations when it is added or edited. This means that you can choose if you want the migration to run recurringly on its own and by which interval. In the first release, only a few intervals can be selected. Later, more complex scheduling will be available.
So if you want to add it to your existing migration, edit it and find the section with scheduled migration.
After you have set a migration to be scheduled, you want it monitor it, to see the status of it.
How to monitor the scheduled migrations
When a migration is set to scheduled, it runs in the background from there. Because of that, it can be difficult to see the status of it.
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