Upgrading WordPress environment from Ubuntu 18.04 to 20.04

Ashok Raja T
Technology Specialist
August 13, 2021
Rate this article
Views    3851

The complexity of upgrading Ubuntu Server from version 18.04 to 20.04 is also dependent on installed applications and software packages. Upgrading Ubuntu 18.04 server is not that complicated and it is a straight case in most common scenarios. In this article, let us see how to upgrade a WordPress environment with Nginx and MySQL running in Ubuntu 18.04 to 20.04.

Upgrade Pre-requisites

Before we start the upgrade process, ensure that all installed packages are upgraded and up to date. To update the existing packages, execute the command “apt update” and "apt upgrade” in the terminal.

The first and foremost step to start with is to take backup of the full server or all critical applications and their data. If anything goes wrong, we would be able to roll back to its original state.

If there is a pending re-start request (usually displayed in the welcome message while you log in to the server), restart the server before proceeding with the next steps.

Upgrade Notice

Whenever there is an OS upgrade available, you would be greeted with a message similar to the one shown below.
upgrade_message

Steps To Upgrade Ubuntu from 18.04 to 20.04

Upgrading is as simple as executing the command sudo do-release-upgrade in terminal. But, the options that we chose during the process of installation are critical to ensure that the upgrade is going smooth.

1. Let us start with executing the command sudo do-release-upgrade in terminal. This would start the upgrade process and it would ask for confirmation on certain steps.

2. As a next step, it would request you to confirm to run an additional SSH daemon in port 1022 to have a fail-safe option. Continue by pressing the y and [Enter] key.
open port 1022

3. In the next step, press the [Enter] key to confirm to disable third-party repo links.
disable third party repos

This would remove the repo URL that you have added to upgrade PHP to version 7.4 in Ubuntu 18.04. To upgrade PHP for WordPress, refer the steps here.

4. The next step is to upgrade packages. Press the key y to continue the package upgrade. The time taken for this step is depended on your internet speed and the number of packages that require an upgrade.
start upgrade

5. Next step is “Configuring libc6”, which requires restarting the system. Select Yes, to perform auto restarts during the installation.

configuring libc6

6. “Configuring lxd” is the next step. The recommended option is to go ahead with version 4.0.

lxd

7. If you have modified any existing system files, the installer would ask for a confirmation of action that has to be performed at the time of upgrade. In most cases, keeping the modified local version or leaving it to the default option would be the best option to go for. sshd_config, grub_loader are some examples.

8. In the next step, all obsolete packages would be removed. Press y and [Enter] to confirm the removal.

remove_obsolete_packages

9. The final step is to restart the server. Press y and [Enter] to restart the server.
upgrade_complete

10. Wait for the system to re-start and connect back again. Check the version of OS by executing the command cat /etc/os-release
ubuntu_20.04

WordPress Specific Validation

Follow the below steps to make sure that your WordPress environment is up and running after the server upgrade.

1. Ensure that PHP is running and pointing to version 7.4 instead of 8.0 by executing the command php -v. This should return that the active version is 7.4.
php_version

Refer to my previous article to change the default version of PHP

2. Ensure that Nginx and php-fpm services are running by checking their status by executing the below commands

systemctl status php7.4-fpm
systemctl status nginx

3. Ensure that firewall is configured correctly by executing the command sudo ufw status

Now you are all good. Wishing you Good Luck on upgrading your Ubuntu Server from version 18.04 to 20.04 🙂

Subscribe To Our Newsletter
Loading

Leave a comment