Data synchronization with Klevu

  1. Check if your CRON is setup properly

    Magento uses CRON jobs for automatically updating currency rates, catalog price rules, Google sitemaps, customer notifications etc.

    Klevu also relies on CRON to synchronize products. It is, therefore, very important that you setup a cronjob to execute cron.php OR cron.sh found in your Magento installation folder.

  2. Product indices must be uptodate
    1. In Magento Admin Panel, Go to System → Index Management
    2. Select All indices
    3. Select Reindex Data in Actions
    4. Click on Submit
    5. To make sure indices remain uptodate
      1. Select Change Index Mode in Actions
      2. Select Update on Save in Index mode
      3. Click on Submit

How do I setup a CRON?

Magento has released its instructions on how to setup a cron at the following URL: http://www.magentocommerce.com/knowledge-base/entry/ce18-and-ee113-installing#install-cron

If you have access to cpanel, here is a good tutorial on setting up cron from your cpanel. http://www.magentotutorials.co.uk/magento-cron-setup-in-cpanel


How to check whether CRON is running or Not?

  1. Point your browser to http://[your-domain]/cron.php. If the browser is able to locate and execute it, the permissions are set properly.
  2. Check time of Last Sync
    1. In Magento Admin Panel, Go to System → Configuration
    2. Open Search Configuration under Klevu
    3. Select storeview from "Current Configuration Scope"
    4. Find Product Sync Settings panel
    5. Check time of the Last Run
    6. If it is too old and does not match with your cron schedule, there might be something wrong with your cron setup or product sync.

If you are on Mangeto version 1.8 or above:

There is a possibility that cron is still not working after setting up a CRON. To solve this, please check the following:

  1. Open the Magento cron.php file in a text editor. You can do this by logging in to your account using SSH, or if your account includes cPanel, from the cPanel File Manager.
  2. Locate the following code block around line 45:
    $disabledFuncs = explode(',', ini_get('disable_functions'));
    $isShellDisabled = is_array($disabledFuncs) ? in_array('shell_exec', $disabledFuncs) : true;
    $isShellDisabled = (stripos(PHP_OS, 'win') === false) ? $isShellDisabled : true;
  3. Copy the following line of code and paste it after the code block above.
    $isShellDisabled = true;
  4. Save the changes to the cron.php file and exit the text editor. The cron job should now run correctly.

You can synchronize updated data immediately by executing the following steps:

  1. In Magento Admin Panel, Go to System → Configuration
  2. Open Search Configuration under Klevu
  3. Find Product Sync Settings panel
  4. Choose "Updates only"
  5. Click on Sync Data

Do you update products directly in DB (manually or using any third party API?) OR Have you imported data using any bulk data import utility?

If the answer is yes, please read the following answer. If no, please write to us at [email protected].

How does Klevu synchronization work?
  • When you update a record from Magento admin panel, Magento updates the updated_at field inside the catalog_product_entity to store the timestamp of when the product was updated.
  • Klevu uses these timestamps to find out which products it needs to synchronize with the Klevu servers.

What could be wrong?

If you make a direct change in the database (manually or using any third party API) or using any bulk data import utility, it is likely that the updated_at field is not updated. For this reason, Klevu is not able to pick up the products for updates.


Solution

Please ensure that the updated_at field is updated. If you usually do not update data in this manner and this was just one of the times, you may try to sync all the product data following the steps below:

  1. In Magento Admin Panel, Go to System → Configuration
  2. Open Search Configuration under Klevu
  3. Find Product Sync Settings panel
  4. Choose "All Data"
  5. Click on Sync Data

Migrating Klevu Search from staging server to a live website

It might be straight forward for you to install Klevu Search on your live server and configure Klevu Search there.

There are two possibilities:

    1. Install and configure Klevu Search on your live environment.
    2. Inform us at [email protected] to delete your store configurations from the staging server.

    1. Install Klevu Search on your live environment and copy JS keys, REST API keys and server URLs from staging environment to your live environment.
    2. Send an email to [email protected] to get rid of your test data from the Klevu indices.
    3. Delete the keys from your staging environment to ensure synchronization is not happening from both the staging and production environment.

The only thing you need to do after changing the base url (from System → Configuration → General → Web → Unsecure Or Secure) is resynchronize all the products.

  1. In Magento Admin Panel, Go to System → Configuration
  2. Open Search Configuration under Klevu
  3. Find Product Sync Settings panel
  4. Select "All Data" option in Sync
  5. Click on Sync Data button

Please note that "All Data" to synchronize option relies on CRON. It is very important that a cron job is setup.