Upgrading Magento from 2.2.x to 2.3.0 can be a bit intimidating if you haven't upgraded a Magento install before but it is a fairly painless process if you follow the right steps. Unfortunately the official Magento site doesn't give a clear step-by-step guide on how to do this so you are left hunting the internet to find a good walk through. In this guide we will give you a clear, easy to follow, guide on how to upgrade Magento 2.2.x to 2.3.0.
The first thing you need to do with any upgrade or major change on a site is take a backup. The steps involved depend on how you host and manage your install. We will walk through a couple common ways to do this.
Backup from Magento 2 Admin
Taking a backup directly out of the Magento 2 admin is very straightforward and will work on any Magento 2 installation. Backups are stored in var/backups so make sure that the user Magento 2 is running as on your server has write permissions to create the files inside of that directory or the backup will fail. For detailed steps read the Magento developer documentation on how to take a backup from the admin panel.
Backup from the Magento 2 CLI
If you prefer to use the CLI, you can also take backups from the Magento CLI. This functionality mirrors the backups from the admin interface but can be scripted if you need to run a bunch of upgrades on your own or client sites. For detailed documentation read the Magento developer documentation on how to take a backup from the Magento 2 CLI.
Take a Server Snapshot on Digital Ocean
If you host your Magento application on Digital Ocean, you can just take a quick snapshot of the droplet so you can quickly restore the entire droplet to it's initial state if anything goes wrong. This works great since, as part of the upgrade process you will in many cases need to upgrade PHP which a backup from Magento wont allow you to rollback from. You can read more about taking a Digital Ocean snapshot in their very detailed snapshots walk through.
Create a Staging Instance on Cloudways
Cloudways is our preferred host for Magento 2 applications and creating a staging instance with the click of a button is just one of the many reasons. This will allow you to mirror your Magento 2 application onto a new staging instance where you can perform the upgrade. If all goes well, you push the changes to the production environment. If not, you can just destroy the staging environment and try again. I would highly reccomend that you look into hosting on Cloudways if you haven't taken a look at it before. For detailed instructions on creating a staging environment, ready their developer documentation on creating staging environments from live sites.
Upgrading PHP to PHP 7.2 or PHP7.1.3+ is a requirement of going from Magento 2.2.x to 2.3. Depending on how you host your site, this can take many forms. There are tons of guides out there on this for Ubuntu, RHEL, Fedora, etc. so we will not re-invent the wheel here. If you are on Cloudways like we are, this is a simple button click. Here is a step by step guide of the PHP 7.x upgrade process.
Upgrade Magento from 2.2.x to 2.3.0
After ensuring that you have a backup and upgrading to a supported PHP version, you are only a few steps away from being done and they all take place in the Magento 2 CLI.
Step 1: Navigate to the root of your Magento 2 installation (where composer.json lives) and run the following: