Magento2: Update from 2.1.9 to version 2.2 Complete but some modules are not updated (composer)

Created on 28 Sep 2017  路  15Comments  路  Source: magento/magento2


Preconditions



Current version (99%) Magento 2.2
Apache Version | 2.4.27
PHP Version | 7.0.23
MySQL Version | 5.6.36-cll-lve
Architecture | x86_64
Operating System | linux

Steps to reproduce

  1. if i run php bin/magento setup:upgrade --keep-generated
    The outcome is good until it wants to update the Magento_Tax module.

Expected result

  1. All modules updated

Actual result


This is the outcome when: php bin/magento setup:upgrade --keep-generated is used

Module 'Magento_Rss':
Module 'Magento_CatalogRuleConfigurable':
Module 'Magento_Authorizenet':
Module 'Magento_SalesInventory':
Module 'Magento_OfflineShipping':
Module 'Magento_ConfigurableProductSales':
Module 'Magento_UrlRewrite':
Module 'Magento_CatalogSearch':
Module 'Magento_Integration':
Module 'Magento_SendFriend':
Module 'Magento_Shipping':
Module 'Magento_Sitemap':
Module 'Magento_Paypal':
Module 'Magento_Swagger':
Module 'Magento_Swatches':
Module 'Magento_SwatchesLayeredNavigation':
Module 'Magento_Tax':
Upgrading data.. Code already exists.

code already exists

When visiting the website:
There has been an error processing your request
Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated:
Magento_Tax data: current version - 2.0.1, required version - 2.0.2
Magento_Braintree data: current version - 2.0.0, required version - 2.0.1
Magento_Wishlist data: current version - 2.0.0, required version - 2.0.1
MyParcelNL_Magento data: current version - 2.1.19, required version - 2.2.0
Shopial_Facebook data: current version - none, required version - 1.0.0

error please upgrade

Outcome:
_Upgrading data.. Code already exists._


Please, is some one having a clue how to resolve this issue?

Clear Description Format is valid needs update

Most helpful comment

I know this is a closed topic. But I thought I would post the actual solution since I just ran into the same error. During the upgrade to 2.2 I ran into the same error Module 'Magento_Tax':
Upgrading data.. Code already exists.

Since websites are made of code, one would think that Magento means there is duplicate code somewhere. Perhaps you would look in the app/code or vendor folder for something duplicate.
Not even close.

The code the Magento installer is talking about is duplicate "codes" as in the column name in the tax_calculation_rate table. Simply check this table for duplicate entries and remove them. Re-run the Magento upgrade command and you will be happy.

Maybe Magento can modify this error to be: "duplicate entry in the tax_calculation_rate table" instead.

All 15 comments

Same issue here, but for only 1 module. So weird. I recently upgraded from 2.1.9 to 2.2

Oh wait, I just follow these steps, and it's now working:

rm -rf app/code/Magento/ var/* vendor/*
chmod 777 -R *
composer update && composer install
php -f bin/magento setup:static-content:deploy
find . -type d -exec chmod 775 {}
find . -type f -exec chmod 660 {}
chmod u+x bin/magento
bin/magento maintenance:disable
bin/magento cache:clean

Credits to: https://magento.stackexchange.com/questions/152968/module-magento-cataloginventory-has-already-been-defined

Thanks for your input.
Now i get another error message.
Problem 1
- The requested package magento/product-community-edition 2.2.0 exists as magento/product-community-edition[0.42.0-beta7, 2.0. 0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.1.0-rc1, 2.1.0-rc2, 2.1.0-rc3, 2.1.0, 2.0.8, 2.0.9, 2.1.1, 2.0.10, 2.1.2, 2. 1.3, 2.0.11, 2.1.4, 2.0.12, 2.1.5, 2.0.13, 2.1.6, 2.1.7, 2.0.14, 2.0.15] but these are rejected by your constraint.

It has to do with this line in compose.json
"require": {
"magento/product-comunity-edition": "2.2.0",

I only don't know if this version number is correct.

Update:
Remove this comlete line "magento/product-comunity-edition": "2.2.0", from the composer.json file and it is working.

Hey,

are you behind a proxy or similar, which may cache some calls to packagist/repo.magento.com?
I think the require-line should read "magento/project-community-edition", with "project" instead of "product". (your composer error/output doesn't even show 2.1.8-2.2.0)

With "magento/project-community-edition" I could install Magento in version 2.2.
Hope this helps

@koopjesboom Thanks for reporting this issue.
Unfortunately, I could not reproduce the issue as you described it.
Could you please share data rows from table tax_calculation_rate (maybe csv file).

@koopjesboom we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

@koopjesboom, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

I know this is a closed topic. But I thought I would post the actual solution since I just ran into the same error. During the upgrade to 2.2 I ran into the same error Module 'Magento_Tax':
Upgrading data.. Code already exists.

Since websites are made of code, one would think that Magento means there is duplicate code somewhere. Perhaps you would look in the app/code or vendor folder for something duplicate.
Not even close.

The code the Magento installer is talking about is duplicate "codes" as in the column name in the tax_calculation_rate table. Simply check this table for duplicate entries and remove them. Re-run the Magento upgrade command and you will be happy.

Maybe Magento can modify this error to be: "duplicate entry in the tax_calculation_rate table" instead.

Had the same issue upgrading from 2.2.1 to 2.2.2. @schoeny1 solution fixed it.

"duplicate entry in the tax_calculation_rate table" instead. @Schoeny1 solution fixed it.
plz check it from phpMyadmin remove duplicate entry .

Hello,

I want to upgrade the magento version from 2.1.12 to 2.2.24, please suggest how can i proceeed ?

Thanks in advance!

Solved! (A while ago) sorry for the delay! Thank you Schoeny1....

@pankaj506 (Wrong topic, i know) Google is your friend. Backup database and magento install dir first at all times. Be aware that you have no customizations or core file changes on default magento 2 files. If you have a test or staging area, test it first. If you don't? pray and hope it works out for you. Befor you proceed : if you changed your .htaccess file backup your .htaccess file. If you have a robots.txt backup your robots.txt to. click on this link Web setup wizard Be careful read every step and you will be fine. If you are not sure Don't touch it! If you think you can manage, Don't touch it. If you are sure, go ahead. Otherwise, call a Developer and prey he wont drain your bank account or bankrupt you.

@pankaj506 as @koopjesboom mentioned about the testing first, this is a must. I always create a copy of the site before I run any upgrades because with Magento 2, you never know what will happen. Document all of your steps and any changes needed to successfully upgrade to the new version. You should then be safe to run the update on your live site. If you are looking for someone to handle the upgrade for you let me know.

If only one module create this issue like : "db schema version: defined in codebase - 1.0.1, currently
installed - 1.0.2" so you open the database and "SELECT * FROM setup_module " check the module version and edit the module.xml file
EX :
Set the both version same then run the command = > php bin/magento setup:upgrade
I hope it will working fine.

Was this page helpful?
0 / 5 - 0 ratings