Don’t Upgrade Just before Holidays: Ubuntu 14 -> 16 breakage!

Just a real quick post. So I did something you really shouldn’t, especially to a work system, so thank god it was only my personal blog server.

I decided do an OS upgrade just before holidays!

So as a quick brain dump I upgraded from 14.04 to 16.04 LTS and the web server wouldn’t work!

Initially this was due to a read only file system. I finally tracked this down to the fact the root file system’s UUID had changed and didn’t match the entry in the /etc/fstab.

The inbuilt Digial Ocean recovery kernel didn’t include any text editors so I couldn’t use that to update the fstab, but the fsck checked out, so that was good.

Two solutions can be used that’s to the following post here:

  1. Speak to Digial Ocean support and get them to attach a special recovery image which can be used to do a number of things including editing the fstab (support response was great, very quick attaching and removing).
  2. Once the system has booted run blkid and then use the new UUDI to remount the filesystem as read/write, which also worked:
mount -rw -o remount UUID=<new UUID> /
vi /etc/fstab

This still didn’t fix the webserver issue. Maybe I should have noticed all the packages it removed but 16.04 doesn’t come with php5 but 7 so initially when trying to start apache I would see the error:

Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration

To get round this I needed (maybe more that minimum):

apt-get install php
apt-get install wordpress
apt-get install libapache2-mod-php7.0 php7.0-curl

Apache now started and the following extra packages were installed:

php-common php7.0 php7.0-cli php7.0-common php7.0-fpm php7.0-json php7.0-opcache
php7.0-readline javascript-common libaio1 libao-common libao4 libflac8 libjs-cropper
libjs-jquery libjs-mediaelement libjs-prototype libjs-scriptaculous libogg0
libphp-phpmailer libspeex1  libvorbis0a libvorbisenc2 libvorbisfile3 mysql-client
mysql-client-5.7 mysql-client-core-5.7 php-gd php-getid3 php-mysql php7.0-gd
php7.0-mysql vorbis-tools wordpress-l10n wordpress-theme-twentysixteen

However Mysql wasn’t running so ran this:

apt-get install mysql-server

Which installed the following extra packages:

libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libfcgi-perl libhtml-parser-perl
libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl
libio-html-perl liblwp-mediatypes-perl libtimedate-perl liburi-perl mysql-server
mysql-server-5.7 mysql-server-core-5.7

After it installed I had to run the following SQL commands as suggested on my WordPress database:

connect <database name>;
REPAIR TABLE `wp_comments`;
REPAIR TABLE `wp_links`;
REPAIR TABLE `wp_posts`;ALTER TABLE `wp_statistics_useronline` FORCE;
ALTER TABLE `wp_statistics_visit` FORCE;
REPAIR TABLE `wp_users`;

Now it all works!!!

Leave a Reply

Your email address will not be published.