Upgrading Magento 2.2.5 to 2.3 (Nightmare)


(Craig) #1

Firstly… I hope you all had a great Christmas :christmas_tree: :grinning:

So, I was back at work today - And one of the tasks I wanted to go over was upgrading Magento 2.2.x to 2.3. Obviously, I’ve covered installing a fresh install of Magento 2.3, which I can pretty much do with my eyes closed now. But upgrading a pre-existing copy… What a painful experience! :rage: :weary: :pensive:

I figured I’d run some tests on one of the 2.2.5 installations that I used in a video earlier this year. I reckon I must have reset and re-tried this task over 20 times. Thank God for DigitalOcean Snapshots!

Anyway, most of the early issues were me trying to take shortcuts in order to optimise the process. However, the majority of re-tries were down to unforeseen issues. Right now, I keep running into this issue where I’m told:

 File doesn't exist: bin/magento
 Check "chmod" section in composer.json of magento/magento2-base package.

I know how to get around this issue, but I’m stumped as to why I’m getting this issue to begin with. It’s an issue you find that relates to bad Permissions/Owners, but everything is setup correctly my end so…

Once I figure this out and optimise the process then I’ll put a video together. Albeit, the steps will be tailored to anyone who may have originally followed the How to install Magento 2.2 tutorial. For example:

  • Ubuntu 16.04
  • PHP 7.0.x
  • Apache
  • Magento 2.x

Anyway, I’ll keep you posted on the progress. I doubt I’ll look at it again until next week. It’ll probably be my first video of 2019. And then maybe I can start concentrating on how to use Magento again.


#2

Hi Craig,

I’ve been struggling to upgrade 2.2.5 to 2.3 but getting nowhere with it.

I originally installed Magento 2.2 by following your “How to install Magento 2.2 tutorial” - so I’m going to wait for your update video on this too.

Keep up the great work :slight_smile:

Stephen


(Fred) #3

Hello Craig,
I am trying to upgrade magento 2.2.6 to 2.3.0 and I though I could use this post to share my issue.

So I have been trying to upgrade via the web setup wizard and I get the following error :

My research of the error lead me on this post https://github.com/magento/magento2/issues/19446

Saying that I could Upgrade to 2.3.0 using a script : https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html

So I downloaded the script, but now I have no clue how to apply that method and proceed to upgrade.

I have been looking forward to your upgrading video, this has also been a nightmare for me so far. Should I use this method?

If you could please share your knowledge, that would be greatly appreciated!!

thanks!


(Craig) #4

Hey @Accessotronik,

This wasn’t an issue I remember coming across. I only do my upgrades from the Command Line Interface (SSH), so our issues may differ ever-so-slightly. I did try the sem-automated script.

It’s been 2-3 weeks since I tried to upgrade. I’ve not been in any rush, because I normally wait a bit for the big updates to get patched (e.g. v2.3.1).

If I get time, I’ll have another go this weekend. No promises though, because I have a lot of personal things to do. In the meantime. I’m happy to share my notes that I was scribbling down at the time. They’re possibly scribblings of a madman. I wouldn’t try to follow them point-by-point, but they may shed some light? If I remember correctly, they kinda worked, but then I had to go back and do something else. I wasn’t happy with the workflow and it was winding me up, so that’s why I benched it for a bit. My notes assume you’re in Production Mode and using sample data because that’s what state my Sandbox store is in.

I’ll update this post with my progress next time I have a go.

My scribbling notes whilst testing the first time I tried
(Disclaimer: The final steps may look nothing like this)

Pre-checks
su magento
cd /var/www/html/
bin/magento deploy:mode:set developer
bin/magento maintenance:enable
Backup
bin/magento sampledata:remove
cp auth.json.sample auth.json
nano auth.json
exit
2. What need upgrading

  1. PHP 7.0.32 > 7.2

  2. Modules:

  3. sudo add-apt-repository ppa:ondrej/php

  4. sudo apt-get update

  5. sudo apt-get install php libapache2-mod-php php-mysql php7.2-soap php7.2-bcmath php7.2-xml php7.2-mbstring php7.2-gd php-common php-cli php-curl php-intl php-zip zip unzip -y
    sudo apt-get remove php-mcrypt -y

  6. sudo a2dismod php7.0

  7. sudo a2enmod php7.2

  8. sudo service apache2 restart

  9. Magento will stop working (incompatible with PHP 7.2)
    sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + && sudo find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} + && sudo chown -R magento:www-data .
    sudo su magento
    cd /var/www/html/
    wget https://raw.githubusercontent.com/magento/magento2/2.3.0/dev/tools/UpgradeScripts/pre_composer_update_2.3.php
    php -f pre_composer_update_2.3.php – --root=’/var/www/html’ --repo=https://repo.magento.com/
    rm pre_composer_update_2.3.php
    composer update
    rm -rf var/cache/* var/page_cache/* generated/code/*
    bin/magento setup:upgrade
    bin/magento sampledata:deploy
    bin/magento setup:upgrade
    bin/magento maintenance:disable