Migrating from Magento 1 (M1) to Magento 2 (M2)

If you are migrating from M1 to M2 and would like to preserve all your settings and the self-learning parameters that the Klevu Search Engine has gathered so far, please follow the guide below.

In case you are planning to use a different API key on your M2 store, please get in touch with us by specifying your M1 and M2 Klevu API keys. We will be able to get the self-learning model copied from M1 to the M2 store but, unfortunately, at this stage, you will have to reconfigure settings in the Klevu Merchant Center yourself. 
  • Prerequisite
    • Products migrated from M1 to M2 should have the same product IDs as set in M1. This will ensure the search led learning gathered in our backend is successfully migrated to M2 as well. If the Magento IDs are going to be different on M2, we would need to know the mapping between the old and the new IDs. Please, share that with us. Please note that transferring learning may incur a small charge which our support team should be able to share with you.
    • On your M2 installation, you must install Klevu Search plugin.
    • If you were given any store specific customizations for your M1 instance, please make sure you have obtained the relevant customizations for your M2 instance as well and they are all in place.
  • Changing the base URL

    If you are going to have a different BASE URL for your M2 instance, please follow the steps below. Otherwise, please go directly to the Copying the Klevu Configuration section below.

      • Login into Klevu Merchant Center (https://box.klevu.com) with the registered Email id and password of your M1 store.
      • Choose the M1 store that you’re migrating from M1 to M2 from the drop down.catalog-sync-select-store
      • Go to Catalog Sync → Base URL(s). Here, you will see the base URL of your M1 store (For example, m1.mystore.com). base-url-m1
      • Change the base URL here to the base URL of your M2 store (e.g. m2.mystore.com). If your products, CMS pages or category pages have different BASE URLs, all of them should be added here as separate BASE URLs.
      • Click on the SAVE CHANGES button. At this stage, the interface may present you an option to remove any old records which contain the old base URL(s). We recommend that you delete the old data.

    Note: Deleting products from the Klevu Search Index will not impact the learning parameters. When the data from your M2 store is synchronized, all the learning parameters will be reapplied to the respective products.

  • Copying the Klevu configuration
    • Login into your M1 Admin Panel; switch to the respective store view and go to the Klevu Search settings.
    • Open another tab and login into your M2 Admin Panel; Switch to the respective store view and go to the Klevu Search settings section.
    • Make sure the various settings (e.g. Tax settings, Additional Attributes to Index) provided in the Klevu Search Settings are identical in both the M1 and M2 instances.
    • Copy the following details from M1 instance to the M2 instance but do not save your changes yet.
      • JS API Key
      • REST API Key
      • All other server URLs M1-M2
    • Delete both the JS API key and REST API key from your M1 instance. This step is very important to ensure synchronization does not happen from both the M1 and M2 instances. 
    • When synchronizing images, Klevu generates its own thumbnails to use in the instant search layout. For this reason, until the sync has completed for your M2 instance, you may see the images not appearing in search. If this is not what you want, we recommend that you turn off Klevu on your M2 instance for the duration when sync is in progress. You can hide Klevu Search on the frontend by choosing the option NO for the setting Enable On Frontend on the M2 instance.
    • Save your settings.
  • SYNCHRONIZING YOUR DATA
    • Please, ensure the Magento indexes are all uptodate.
    • There are two methods of synchronizing data. If you are going to rely on Magento’s CRON please follow the steps below:
      1. In Magento Admin Panel, Go to Stores → Configuration and open Search Configuration under Klevu
      2. Find Data Sync Settings panel
      3. Choose the option “All Data” and click on the “sync data” option.
      4. Please make sure your CRON is working properly.
    • If you are going to use a shall script to perform synchronization, please follow the steps below:
      1. In Magento Admin Panel, Go to Stores → Configuration and open Search Configuration under Klevu
      2. Select the option Never for the Frequency setting under the Data Sync settings (the option is visible at the default config level)
      3. Click on the Save Config button.
      4. Fire the following command from the command line.
        php bin/magento klevu:syncdata –alldata
      5. For any future updates, please set up a cron to execute the following command every 15 mins.
        php bin/magento klevu:syncdata –updatesonly
  • ENABLING SEARCH ON FRONT-END
    If you had disabled Klevu Search on the frontend, please wait for the sync to complete. Once it is done, you can enable search by choosing the option Yes for the Enable On Frontend setting. Save the config and refresh your cache.