Category id are same except entity_id 1 missing

https://snipboard.io/I8spnY.jpg
But when we check in new migrated db, we see it is missing entity_id 1.

Our fear is that will cause problem
Missing category:
https://snipboard.io/951rxO.jpg
**Urgent help required**

  1. Profile photo of Mag MMag M 790.00 $tone September 12, 2019
    1809 records in old(m1), 1808 records in new(m2)
  2. Profile photo of Mag MMag M 790.00 $tone September 12, 2019
    When we try to access Categories tab it throws error and I guess that is the reason.Fatal error: Uncaught Error: Call to a member function getId() on null in /var/www/html/uswf/vendor/magento/framework/Data/Tree/Dbp.php:380 Stack trace: #0 /var/www/html/uswf/vendor/magento/module-catalog/Block/Adminhtml/Category/AbstractCategory.php(157): Magento\Framework\Data\Tree\Dbp->loadEnsuredNodes(Object(Magento\Catalog\Model\Category\Interceptor), NULL) #1 /var/www/html/uswf/vendor/magento/module-catalog/Block/Adminhtml/Category/AbstractCategory.php(112): Magento\Catalog\Block\Adminhtml\Category\AbstractCategory->getRoot() #2 /var/www/html/uswf/vendor/magento/module-catalog/Block/Adminhtml/Category/Edit/SaveButton.php(25): Magento\Catalog\Block\Adminhtml\Category\AbstractCategory->hasStoreRootCategory() #3 /var/www/html/uswf/vendor/magento/framework/View/Element/UiComponent/Context.php(285): Magento\Catalog\Block\Adminhtml\Category\Edit\SaveButton->getButtonData() #4 /var/www/html/uswf/vendor/magento/module-ui/Component/AbstractComponent.php(116): Magento\Framework\View\Element\UiComponent\Context->addButtons(Arr in /var/www/html/uswf/vendor/magento/framework/Data/Tree/Dbp.php on line 380

2 answers

Profile photo of Mall Staff 184060.00 $tone September 12, 2019
Public

Hi there,
Lets run more SQL below in your M2 database to fix the issue you mentioned:

INSERT INTO `catalog_category_entity` (`entity_id`, `attribute_set_id`, `parent_id`, `created_at`, `updated_at`, `path`, `position`, `level`, `children_count`) VALUES ('1', '3', '0', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '1', '0', '0', '0');

Regards,
Mall.

#1
Profile photo of Mall Staff 184060.00 $tone September 12, 2019
Public

Hi there,

https://snipboard.io/I8spnY.jpg

If you redo that steps once more at your end, after you are done with the step 4, please implement additional step below:

+ Open the php file at: pub/ub-tool/protected/controllers/Step4Controller.php
and find the code line:

$condition = 'entity_id > 1';

and replace it with: 

$condition = 'entity_id > 0';

+ And then you can continue with the step 5. 

Regards,
Mall.

#2

Please login or Register to Submit Answer

Written By

Comments