How to Update Drupal from 8.5.5 to 8.6.15

How to Update from Drupal 8.5.5 to 8.6.15

Few things to keep in mind when updating from Drupal 8.5.5 to Drupal 8.6.15
  1. If your site uses taxonomy for the content management on your site, you will get an error because the schema has been changed. The table called taxonomy_term_hierarchy has been removed in Drupal 8.6.0 (Read Here) and replaced by taxonomy_term_parent. For sites that were installed by using Composer and have been around since Drupal 7, then you might want to research on how to apply a patch. For my workaround, I just created the table after performing drush updb and drush update-entities. It was really hard to find out what exactly was going on.
  2. Some people have reported losing data during the migration from Drupal 8.5.5 to 8.6.15, make sure you backup all your databases as well as the production site and test all the backups to see if they work without errors then move on to update/upgrade.
  3. After the update and you see some content on your site couldn't display: Check a table called block_content_field_data and update with the SQL code below (replace databaseName with your databaseName);

    SELECT * FROM databaseName.block_content_field_data;
    set sql_safe_updates = 0;
    update databaseName.block_content_field_data set reusable = 1  where reusable IS NULL;



    What happened was that, when updating to Drupal 8.6.15, the table was dropped and created, the reusable column was added with NULL data.
  4. After the update and you see all the blogs/content on your website is gone: Log into the Database and find the table called taxonomy_term_field_data. Drupal 8.6.15 Added a column in this table called "status" and populated the column with "NULL" values that are the main cause of data not displaying: Run the following code on your database (replace databaseName with your databaseName);

    set sql_safe_updates = 0;
    update databaseName.taxonomy_term_field_data as b set b.status = 1  where b.status IS NULL;


    [NB] This is how I resolved my update problems, of course, every situation is different, make sure you research your problem and don't forget to make several backups of your live site, databases, and logs on different computers or disks. This will help you in case you want to revert the changes. In my case, I attempted multiple upgrades that were unsuccessful.
  5. If you can't get access to your remote Database Server, make sure the "my.cnf" file has correct Address binding: Under [Mysqld] add (bind-address = ::) which means, the server will listen for traffic from all IP Address include IPv6 as well. For security reasons, the production Database Server should not listen for traffic from all IP addresses.

    80 percent of the time, when you can't connect to remote Database Server is because the Database Deamon is listening on a different Network Interface (localhost), make sure the configuration is right for remote access.

    Resources:
    Read Problems Here
    Source Here
    Update Drupal with Composer