User Sync

Configure one-time user sync for new installations

 2 minute read

User sync is required once for new installation of Blesta or Cerb. As mentioned in Cerb Configuration, Blesta Clients are tied to a Cerb organization and the user sync creates that initial mapping between the two.

Once users are synced from Blesta to Cerb, the Blesta-Cerb plugin will automatically update Cerb when users (Clients and Contacts) are created and updated by Blesta users, order forms, staff or any Blesta API call. It does this by using Blesta Events.

User sync operations are considered safe in that it will never remove data from either Blesta or Cerb and can be ran multiple times. However, it is best practice to always create a backup in case of unknown issues.

Run User Sync

To run a manual user sync:

  • [Admin Portal] -> [Select your Company] -> [Cerb] -> [User Sync]
  • Click the button [Create Sync Job]

This will create a Blesta cronjob entry that will batch requests and perform a sync between Blesta and Cerb. This process is highly scalable and follows best practices with Blesta.

You can track the progress of all sync operations by viewing the table on the User Sync page.

Increase performance of User Sync

If you have a large number of clients and contacts, you might consider increasing Blesta.results_per_page option in config/blesta.php temporarily; the default value is 20.

The way cron based user sync operates work, is that it fetches a list of Blesta clients up to the value defined by Blesta.results_per_page and operates on them. If you have 100 Blesta clients, it will batch the sync operation into 5 sequential operations of 20 clients per batch. Likewise, if you have 3,000 Blesta clients, it will batch the sync operation into 150 sequential operations of 20 clients per batch.

Because the smallest granularity of Blesta cronjobs is every five minutes, 100 Blesta clients would take 25 minutes to sync with the default value of 20 for Blesta.results_per_page. Doubling the value would decrease the total time spent waiting for the sync operation to complete.

Take great care when increasing Blesta.results_per_page as doing so will increase PHP memory footprint and execution time for the cronjob. A value too high might result in a sync batch that does not fully complete.

Increasing PHP’s memory_limit and max_execution_time can overcome these challenges.

Last modified August 1, 2020: (9e61bb7)