Step-1 : Create a backup or Snapshot of your WordPress Server
Note: As a precaution, first of all create a backup or snapshots before proceeding to upgrade and If anything goes wrong then backup or snapshots will help you to restore your WordPress website in a last working state.
Step-2 : Upgrade from Ubuntu 16.04 to Ubuntu 18.04 using its upgrade scripts
Now, Update package repository to latest:
$ sudo apt-get update
Next, Upgrade packages:
$ sudo apt-get upgrade
You will remove unwanted packages and upgrade Ubuntu 16.04 LTS to the latest version:
$ sudo apt-get dist-upgrade
Finally run the upgrade scripts:
$ sudo do-release-upgrade
Follow all the instructions during the running of upgrade scripts.
Step-3 : After upgrade finally your WordPress shows you 404 error.
Now find and replace it with correct version of PHP from
Edit Apache virtual host:
$ sudo nano /etc/apache2/sites-available/example.com.conf $ sudo nano /etc/apache2/sites-enabled/example.com.conf
Edit Apache configuration file:
$ sudo nano /etc/apache2/apache2.conf
Restart the Apache services to make changes in effect:
$ sudo systemctl restart apache2
Edit Nginx server blocks:
$ sudo nano /etc/nginx/sites-available/example.com $ sudo nano /etc/nginx/sites-enabled/example.com
Edit Nginx configuration file:
$ sudo nano /etc/nginx/nginx.conf
Restart the Nginx services to make changes in effect.:
$ sudo systemctl restart nginx
If this still shows you error then look carefully which packages has been upgraded. This given table will help you to find out issues.
Step-4: Each Package version comparison table from Ubuntu 16.04 to Ubuntu 18.04
This table can help you to make changes to your configuration files for resolving issues.
|Ubuntu 16.04||Ubuntu 18.04|
Congratulation now you have upgraded your WordPress server from Ubuntu 16.04 to Ubuntu 18.04. Now you will take advantage of latest feature and security for your server. If you have issues regarding this tutorial then you will use the comment section below.