Magento 2 Composer.json

Magento 2 – Development – Part 1b: Upgrade Magento 2.3.3 to 2.3.4

Upgrade Magento 2

All over the internet there are so many articles showing how to upgrade Magento 2 the quick and nasty way. In turn NOT the Magento 2 certified developer way. Even though however you update your Magento 2 instance, don’t take the “if it works it works” approach but try to conform to best practices.

Whats the Quick and dirty way.

The quick and dirty way is very simple is to go into the composer.json file and looking for the require section, locating magento/product-community-edition and changing the version number.

Magento 2 Composer.json

and once modified going to a terminal and executing the following:

composer update

This is normally perfectly acceptable BUT you don’t know of any issues until its to late.

Upgrade Magento 2.3.3 to Magento 2.3.4

The correct way to upgrade Magento 2 is to do the entire upgrade process via a terminal window using composer command line.

cp composer.json composer.json.bak
composer remove magento/product-community-edition --no-update

First we remove the original Magento product from composer file. Why? Simply to make sure there re no issues

composer require magento/product-community-edition:2.3.4 --no-update

Then we re-require the product along with the newer version again not to update as we wish to update everything after.

composer update

At the composer update phase we shall know if there are any issues. But i got an error after reloading?

You will need to run the rest of the standard Magento commands for upgrading or installing as the database has likely changed.

bin/magento setup:upgrade
bin/magento setup:di:compile 
bin/magento setup:static-content:deploy en_GB  -f 
bin/magento c:f # c:f is short for cache:flush

Magento 2.3.3 Commerce to Magento Commerce 2.3.4

So whats the difference between upgrading magento 2 community edition and Magento 2 Commerce On premise edition. There is no real difference.

The process is exactly same all that is different is the package name.

cp composer.json composer.json.bak
composer remove  magento/project-enterprise-edition --no-update
composer require magento/project-enterprise-edition:2.3.4 --no-update
composer update

Magento 2 Commerce Cloud upgrade (starter and pro)

Magento 2 commerce cloud is slightly different though the principle is still the same once you have downloaded the project locally using:

magento-cloud login
magento-cloud ssh-key:add
magento-cloud get

We can follow the same process for upgrading the framework:

composer remove magento/magento-cloud-metapackage --no-update
composer require magento/magento-cloud-metapackage=">=2.3.4 <2.3.5" --no-update
composer update

You can see the main difference is its not a product but a meta package with a version defined different >=new version .

Now that’s updated locally doing a simple git add and push to the server will deploy the new version to the current active branch, you will need to repeat this up the branches untill you reach both the staging branch and production branches.

git add -A
git commit -m "upgrade magento  2"
git push

I hope this clears up how to upgrade magento 2 the correct way rather than the “not so best practice” way. If you want more help using composer or installing magento read some of our other articles.

Magento 2 – New Module – Hero Banner and Slider

Here at boxleaf digital we like to make sure, we share some of our custom modules for FREE, why because we like to help smaller businesses with functionality. If we have written it feel free to use it.

Our Hero Banner and Slider widget was written to give you more flexibility. As we know the most important part of any site, is to catch your customers attention, with nice looking banners and sliders.

BoxLeaf_HelloWorld disabled

Magento 2 – Development – Part 2: Creating a new module

This article will go the process and requirements of creating a new Magento 2 module. There are allot of articles out there discussing creating your first module that’s because there is a number of ways of doing this and each Developer has there own preference for manageability. At boxleaf Digital this is our preferred way to make code manageable.

Composer Logo

Using composer to manage web projects

How to use composer properly. Composer is a package management tool for PHP. Helping you declare and manage your projects library dependencies.

Unlike Operating systems such as Linux and MacOsx, composer is NOT a package manager such as systems like YUM, APTITUDE, APT or HomeBrew.  But more of a project by project basis dependency manager, since everything is installed within the ./vendor directory and not a global scale.

Composer however does have a global dependency section though, this is more to assist with the project dependencies.

So if you have a project whether that be a framework or a custom PHP application. Whilst either of these can have requirements you can tell composer to require these libraries within. Whilst have it manage there dependencies as well as the projects dependencies.

Magento 2 Dashboard

Magento 2 – Management – Login and Dashboard

Magento 2 Dashboard

The magento 2 dashboard and other areas of the Magento 2 backend UI all contain the common elements. But to get started with learning to magento 2, its first better if introduce you to the difference components.

Whilst there are many, the main concept is the big orange button on the “Top Right” within the grey bar. The orange buttons always signify a magento 2 important actions in the case of the dashboard this is Reload Data. 

Though in other areas this may be such things as  ADD NEW SOMETHING.

The second most component is within the grey bar this is the store selector component, il go into more detail about this shortly.

For reference of what I’m referring to watch the video at the top or see the image below.

Magento 2 Backend store selector

Magento 2 Backend store selector

Magento 2 Marketplace

Magento 2 – Development – Part 1: Install with composer

This blog and video series is going to take you through the fundamental basics of developing with Magento 2 based around the 2.3.* version, though the practices learned should all be compatible with earlier versions also.

Though this series is for beginners with the Magento 2 framework, it does consider you have already gained some knowledge about using command line tools, and PHP.

So to get all the benefits of Magento 2 we are going to discuss how to install it, but how to do it the right way, to comply with magento’s best practices.

Send us a Skype message

boxleafdigital

Call boxleaf Digital