Jump to content

Problem after Migrating from Prestashop 1.3 to Prestashop 8


Recommended Posts

Hello.

We migrated from Prestashop 1.3 to Prestashop 8.

We discovered that we cannot manage the add or edit of categories to products.

search-category.thumb.jpg.6ffbd56b9d8736e5bc83dd3738834e7f.jpg

What we saw is that in the 1.3 database, category 1 is (HOME) and (root).

data-3-1.jpg.fcb612f993d154a6765038235a3ff353.jpg

In the Prestashop 8 database, category 2 is (HOME) and (root).

data-8basic.thumb.jpg.c9aa034323ef8f0cec6066f25fbe959f.jpg

In the database of 8 after the migrate, category 1 is (root) and category 2 is (HOME)

migrate-from-1-3-to8.jpg.6321aacd5e716d4a7b5f3671048b04f6.jpg

Also, category 1 has id_parent (582), a category created during migration that did not exist in 1.3 and is not processed in the Prestashop back end (The object cannot be loaded (or found).

cat-582.thumb.jpg.cc040fbf8adb3377ff935f9dee11dcc0.jpg

First of all, I would like to ask if it is possible to migrate from Prestashop 1.3 to 8 and if there is a solution to the above problem.

Thank you.

 

Link to comment
Share on other sites

24 minutes ago, ComGrafPL said:

I did one time 1.3 but to 1.7 and 1.4 to 8. With some issues. Regarding categories. They are working on new products? Issues are only on migrated ones?

The problem also exists in the new products we add.

Link to comment
Share on other sites

  • 4 weeks later...

The new category is "root". It comes below your Home category. It was introduced in version 1.5 together with multi-shop. As it is created during the update to 1.5 it will have a high id number.

Your category tree problems signal some problem with the nleft and nright fields.

You could try my free Prestools. It has an Integrity Checks function that includes an option to regenerated this tree.

I made some upgrade tools (Copy_shopdata and UpgradeHub ) but they won't go further back than 1.4.9 at the moment.

Link to comment
Share on other sites

In PrestaShop 1.5+ the category structure was changed, and the system expects:

ID 1 = Root

ID 2 = Home

When a shop is migrated from very old versions (like 1.3), these IDs often remain reversed. As a result, the Back Office cannot correctly load or attach categories to products.

In your migrated database the structure is incorrect:

Category 1 is not Root

Category 2 is not Home

Category 1 even has an invalid parent (ID 582)

This breaks the nested-set structure (nleft / nright) and causes exactly the issue you describe.

The fix is:

Set category ID 1 to be the real Root category:

id_parent = 0

Correct values for nleft, nright, level_depth

Set category ID 2 to be the Home category, with:

id_parent = 1

Make sure all other categories connect under this tree properly.

Regenerate the category nested set (nleft / nright) after correcting IDs.
Prestools or the built-in Category::regenerateEntireNtree() can rebuild the tree.

Once Root is ID 1 and Home is ID 2—as PrestaShop 8 requires—the product category selector will work normally again.

Link to comment
Share on other sites

10 hours ago, Reha Ultimate said:

In PrestaShop 1.5+ the category structure was changed, and the system expects:

ID 1 = Root

ID 2 = Home

When a shop is migrated from very old versions (like 1.3), these IDs often remain reversed. As a result, the Back Office cannot correctly load or attach categories to products.

In your migrated database the structure is incorrect:

Category 1 is not Root

Category 2 is not Home

Category 1 even has an invalid parent (ID 582)

This breaks the nested-set structure (nleft / nright) and causes exactly the issue you describe.

The fix is:

Set category ID 1 to be the real Root category:

id_parent = 0

Correct values for nleft, nright, level_depth

Set category ID 2 to be the Home category, with:

id_parent = 1

Make sure all other categories connect under this tree properly.

Regenerate the category nested set (nleft / nright) after correcting IDs.
Prestools or the built-in Category::regenerateEntireNtree() can rebuild the tree.

Once Root is ID 1 and Home is ID 2—as PrestaShop 8 requires—the product category selector will work normally again.

That is not correct.

When you upgrade from 1.4 to 1.5 it will create a new category with the name "root" and that category will get the next available id number.

Link to comment
Share on other sites

6 hours ago, Reha Ultimate said:

 My friend, it is Prestashop 1.3 to Prestashop 8 migration, not to 1.5

Prestashop's autoupgrade module works step by step, processing sql files that list what must be changed in the database for the next version. And at some point during that process it will cross the 1.4-1.5 border and add the root category. 

Those files are found in the /install/upgrade/sql directory (up to 1.7.0) and /modules/autoupgrade/upgrade/sql (after 1.7)

Of course third party tools can choose to work in another way.

sqls.jpg.3b46537cc6271dd52ab6a8330891a7ee.jpg

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...