Update procedures for Ubuntu Server, Nginx and MySql

These update procedures contain only essential information and best practices for updating a running ubuntu server and keeping the downtime low.

Ubuntu 16.04.6 to Ubuntu 18.04

Backup – If you use a cloud hoster like digitalocean, create a snapshot. It’s recommended to power off the VM before creating the snapshot for keeping file integrity. If you do not use a virtual machine or cloud hoster, it is recommended to make a copy of the entire file system. At least you need to back up the directories /home, /etc and /var

Update Installed Packages

Before beginning the release upgrade, it’s recommended to update to the latest versions of all packages for the current release. Update the package list:

sudo apt-get update

Next, upgrade installed packages to their latest available versions:

sudo apt-get upgrade

When this is finished use the command below. This will execute additional updates that require changing dependencies, adding, or removing new packages if necessary. It will process upgrade steps which may have been kept back by apt-get upgrade.

sudo apt-get dist-upgrade

Upgrade Ubuntu to 18.04

sudo do-release-upgrade

Update from MySQL 5.7 to 8.0

Download package config

wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb

reconfigure packages

sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb

Update packages

sudo apt-get update

Update MySQL

sudo apt install mysql-client or mysql-server

 

 

Author: Rene Hermenau

I'm René Hermenau, founder of WP STAGING. I've been building WordPress infrastructure software since 2013 and writing code on GitHub since 2011. My repos live at github.com/rene-hermenau. WP STAGING started as a small developer project solving the same problem I kept hitting on client work: there was no fast, safe way to clone a WordPress site for staging or migration without breaking serialized data, file paths, or media references. Today we are a team of more than 10 people. The free plugin runs on hundreds of thousands of WordPress installations, and the Pro version powers backup, migration, and staging workflows for agencies, hosting platforms, and ecommerce stores. I'm still hands-on with the codebase and technical architecture. Our releases are built as a team, but many of the core architectural decisions are ones I helped design, test, and evolve over the years: how we handle large database exports, how we keep memory usage flat on multi-GB sites, and how we make migrations atomic against partially written tables. "When you touch code, leave it 10% better than before and write a test." If you're stuck on a WP STAGING question, the docs are at wp-staging.com/docs. If you hit a bug, file it on GitHub at github.com/wp-staging. Our team reads everything that lands there.