Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.
Jared Cobb edited this page Jun 12, 2019 · 3 revisions

Running A Sync

Assuming you have configured a TMS Database connection, you can now run a synchronization via WP CLI.

Commands

Sync

wp tmsconnect sync [--reset] [--batch-size=<num>] [<processor>...] [--force] [--post-processing]

By default, the command will attempt synchronize all content types and all taxonomy terms. The command will keep track of the "last known synchronization position" (via a cursor) and attempt to continue a sync if it previously failed.

--reset Default is false. Force the sync to start at the beginning.

--batch-size Default is 200. Set how many objects are synchronized before flushing cache and releasing memory.

processor Default is all. Determines which objects to synchronize.

--force Default is false. If an object already exists in WordPress, overwrite it. Typically used along with --reset.

--post-processing Default is true. Whether or not to run additional scripts after the synchronization is complete. For example, linking terms to objects.

Delete

wp tmsconnect force_delete_objects

Forces a complete purge of all TMS Objects in WordPress. This is useful if you need to re-initialize a collection and start from scratch.

Example

When performing a new synchronization, run the command with the --reset flag. But if the script fails (or you need to cancel it) then run the command without the --reset flag in order to avoid starting over again (picking up where you left off).

If you wanted to start a new TMS sync for only objects, wanted to overwrite any existing objects, and wanted to lower the batch size, you would run the following commands:

wp tmsconnect sync object --batch-size=100 --reset --force
wp cache flush
Clone this wiki locally