Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration\Step\Inventory\Model\StockSalesChannel does not remove original record from installation prior to insertion of new records #715

Closed
dfelton opened this issue Aug 22, 2019 · 1 comment
Labels

Comments

@dfelton
Copy link
Contributor

dfelton commented Aug 22, 2019

Preconditions

  1. Magento 1.x store has had it's original installation frontend website with a code of base either renamed or removed (core_website.code table column).

I suspect version of 1.x and 2.x platform is irrelevant, that this issue may apply to all versions. However I can confirm that this issue is reproduce-able on a stock code base of Magento EE 1.14.4.2 and Magento Commerce 2.3.2.

Steps to reproduce

  1. Install Magento 1.x.
  2. Post Installation, log into the admin, navigate "System -> Manage Stores".
  3. Click the "Main Website" to open it for editing.
  4. Change the code from base to foobar.
  5. Install Magento 2.x.
  6. Install the data-migration-tool of the corresponding version for the 2.x platform.
  7. Configure the necessary config.xml.dist, only modifying the database settings in order to perform migration.
  8. Migrate settings.
  9. Migrate data.

Expected result

  1. Post migration, the inventory_stock_sales_channel should only contain one record as there is only one frontend website present in the 2.x platform.
  2. Users should be able to log into the admin and navigate to "Stores -> Inventory Manage Stocks" and view page without error.

Actual result

  1. inventory_stock_sales_channel has two records, the original record from installation, and the record added from the Inventory Step of the migration tool.
select * from inventory_stock_sales_channel;
+---------+--------+----------+
| type    | code   | stock_id |
+---------+--------+----------+
| website | base   |        1 |
| website | foobar |        1 |
+---------+--------+----------+
  1. Navigating the admin to the "Stores -> Inventory Manage Stocks" page yields the following error:

The website with code base that was requested wasn't found. Verify the website and try again.

Additional notes

Solution: The Migration\Step\Inventory\Model\StockSalesChannel model should empty the table prior to performing the INSERT FROM SELECT, in order to remove the record added during installation. If the 1.x platform still has a website with a code of base, it will be re-inserted from the INSERT FROM SELECT, if it has been renamed or removed prior to migration, this erroneous record will not be present post-migration.

@victor-v-rad
Copy link
Collaborator

Hi @dfelton

Thank you for reporting this issue. Internal MC-19627 ticket to process it

victor-v-rad added a commit that referenced this issue Sep 20, 2019
…from installation prior to insertion of new records #715
@victor-v-rad victor-v-rad reopened this Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants