Upgrading Magento 2.2.5 to 2.3 (Nightmare)

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.

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:


1 Like

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!!


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)

su magento
cd /var/www/html/
bin/magento deploy:mode:set developer
bin/magento maintenance:enable
bin/magento sampledata:remove
cp auth.json.sample auth.json
nano auth.json
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

hello i also hv a night mare in upgrading my website

could u help me?

Hi @khaled_bm,

I’ve not yet found the time to research and solve this problem. However, based on both the Error and the Path I’m going to make 2 assumptions (correct me if I’m wrong):

  1. You’re using a Shared Hosting account (based on the web directory name /home/buildi12/public_html)
  2. The .github file does not have the correct permissions or ownership (based on the fact that it’s not writable)

Typing ls -la /home/buildi12/public_html will show you both the owner and permissions of the .github file - Which should shed some light on the issue for you. If you are using Shared Hosting, then I can’t give you anymore tips unless you provide more details about your specific setup.

Exciting News!!!

I’ve made significant progress with this tutorial. I promised myself I’d have some time off over the weekend, but I’m clearly crazy.

I’ve resolved all of the issues that stopped me from doing this tutorial - And I’ve documented them in separate posts along with the solution. The tutorial will show you how to upgrade from 2.2.8 > 2.3.1, but in theory they should work regardless of whatever version of 2.2.x you are on.

This is my To Do List before the video will go live:

  1. Convert my notes into an easy-to-follow Tutorial
  2. Test the tutorial
  3. Record the tutorial
  4. Post-Edit the video

I suspect it’ll be a couple of weeks before the video is ready. But I might post the instructions before the video.

If anyone has a 2.2.x server and would like to test these instructions on their own server before a video comes out, send me a PM.

EDIT: Tutorial now available here!