The PowerSync connector for Magento and Salesforce platforms enables merchants to synchronize data between both platforms based on a Schedule and in Real-Time.

Table of Contents

Prerequisites

Run the following command in the Magento root using the console

...

If you see this command, you should be ready and can proceed.

Server Configuration

If you don’t know how to configure Magento CRON jobs, see the Magento CRON job documentation.

...

Info

Examples below assume your Magento root folder is var/www/html.

Example (for PowerSync connector version 2.7 and above)

Tip

This is the latest version of the PowerSync connector

Code Block
### Process bulk requests from Salesforce
*/5 * * * * php -f /var/www/html/bin/magento tnw_salesforce:cron:run incoming -a >> /var/www/html/var/log/sforce-incoming.cron.log

## temporary data cleanup
* * * * * php -f /var/www/html/bin/magento tnw_salesforce:clean:queue >> /var/www/html/var/log/sforce-clean-queue.cron.log
*/5 * * * * php -f /var/www/html/bin/magento tnw_salesforce:clean_system_logs >> /var/www/html/var/log/sforce-clean_system_logs.cron.log
Note

IMPORTANT: You might need to also register the Magento queue listeners manually.
Follow the manage message queues documentation and add the following listeners to your /app/etc/env.php file.

  • tnwSalesforceSyncRealtimeAmqp

  • tnwSalesforceSyncRealtimeDb

  • tnwSalesforcePrequeueProcessDb

  • tnwSalesforceQueueProcessBackgroundDb

  • tnwSalesforceQueueProcessNormalDb

  • tnwSalesforcePrequeueProcessAmqp

  • tnwSalesforceQueueProcessBackgroundAmqp

  • tnwSalesforceQueueProcessNormalAmqp

  • tnwSalesforceQueueProcessCheckNormalDb

  • tnwSalesforceQueueProcessCheckNormalAmqp

  • tnwSalesforceQueueProcessCheckBackgroundDb

  • tnwSalesforceQueueProcessCheckBackgroundAmqp

  • tnwSalesforceSyncQuoteDb

  • tnwSalesforceSyncQuoteAmqp

  • tnwCountryStateUpdateConsumerDb

  • tnwCountryStateUpdateConsumerAmqp

...

  • the “Ampq” suffix added to the consumers for the RabbitMQ Message Queue

  • the “Db“ suffix has consumers for the Standard(MysqlMQ) Message Queue

Configuring the Magento 2 extension

Example (for PowerSync connector version 2.6 or older)

Code Block
### Process bulk requests from Salesforce
*/5 * * * * php -f /var/www/html/bin/magento tnw_salesforce:cron:run incoming -a >> /var/www/html/var/log/sforce-incoming.cron.log

## Send records to Salesforce
*/5 * * * * php -f /var/www/html/bin/magento tnw_salesforce:cron:run background -a -p >> /var/www/html/var/log/sforce-background.cron.log
*/2 * * * * php -f /var/www/html/bin/magento tnw_salesforce:cron:run outgoing -a -p >> /var/www/html/var/log/sforce-outgoing.cron.log

## Check records in Salesforce
*/2 * * * * php -f /var/www/html/bin/magento tnw_salesforce:cron:run background -a -c >> /var/www/html/var/log/sforce-background.cron.log
*/2 * * * * php -f /var/www/html/bin/magento tnw_salesforce:cron:run outgoing -a -c >> /var/www/html/var/log/sforce-outgoing.cron.log

## Prepare records for Salesforce
* * * * * flock -n /var/www/html/var/locks/sforce-prequeue.lock php -f /var/www/html/bin/magento tnw_salesforce:cron:prequeue >> /var/www/html/var/log/sforce-prequeue.cron.log

## temporary data cleanup
* * * * * php -f /var/www/html/bin/magento tnw_salesforce:clean:queue >> /var/www/html/var/log/sforce-clean-queue.cron.log
*/5 * * * * php -f /var/www/html/bin/magento tnw_salesforce:clean_system_logs >> /var/www/html/var/log/sforce-clean_system_logs.cron.log

...