PrestaShop categories block empty after migrating from osCommerce

To migrate an osCommerce webshop to PrestaShop 1.5 I used the migration module from Presto Changeo. It worked just as specified, importing categories, products and customers from a running osCommerce webshop. One important thing before you start is that the module will empty all your existing customers, categories and products in your PrestaShop so make shure you are using it on a new shop.

I’ve been working on the PrestaShop installation for a while so it was not a fresh 1.5 install but had been upgraded from 1.3 to 1.4 and then 1.5 (yes it has not been in production before). This is probably the cause of my problems that occured.

The module works fine even if the osCommerce is running on a different servern than the PrestaShop. I small php file must be uploaded on the server running the osCommerce. The import can take several hours especially if there are many products and images. The script can be running in the background emailing you the progress each 5 minutes. If the mail stops coming or you get an error 500 when running in the foreground you simply must go into the module and click resume each time an error 500 occurs until the import is completed.

After the import I could see the categories, products and customers in the back office but the front office blockcategories didn’t show any products. I found that the problem probably was caused by the support for multistore introduced in PrestaShop 1.5.

Solution: 

  1. You need to access the PrestaShop MySQL databas using phpMyAdmin.
  2. Open the table ps_categories. The id_category 1 is the root category. Find which id the home category has (it will have the field is_root_category set to 1). The home category is probably id_category 2.
  3. Open the table ps_configuration and find the key PS_ROOT_CATEGORY and make shure it has value ‘1’ (the id_category of the root category).
  4. Find the key PS_HOME_CATEGORY and make shure it has the value of id_category for the home category, probably ‘2’.
  5. Go to the back office, in the preferences menu go to the general settings. Activate multi store.
  6. In the advanced parameters menu, go to Multi store. 
  7. Click on the default group and edit your store. Select the Home category as Root category. Save the store.
  8. Go back in the preferences menu general settings and disable the multi store.

Now the categories should display in the blockcategories in the front office.