Home

yyhh.org

  • Home
  • Notebook
    • Management
      • GTD
    • Math
      • CategoryTheory
    • Programming
      • Clojure
      • Java
      • Python
    • Psychology
    • Software
      • AWS
      • Drupal
      • FreeIPA
      • LaTeX
      • Linux
      • OSX
      • Spacemacs
      • Vim
  • Experience
    • Extraordinary
    • House
    • Pets
    • Shopping
    • Travel
  • Opinion
    • China
    • Politics
    • Religion
    • Science
    • Society
    • Technology
  • About

Breadcrumb

  • Home
  • Upgrade Drupal from 6 to 8
    • Print

    Upgrade Drupal from 6 to 8

    Submitted by Huahai on Tuesday, November 21, 2017 - 23:46.
    Drupal
    Upgrade Drupal from 6 to 8

    Since Drupal 6 is no longer supported, I upgraded this site to the lasted version of Drupal 8.4.2 by following the guide. As you can see, the upgrade mostly worked. However, there are a few points of caution as well as some unresolved problems.

    As before, I setup a test site in a sub-directory (h/drupal) of the main site (/h) and assigned a domain name to the test site. The test site use a new empty database. The idea is to keep the old site running, and migrate the data from the old to the new. 

    This blog is on a hosted service that allows direct SSH access, so it made things a lot easier. Drush helped a lot. To get drush to work, I had to modify the drush bootstrap script to use php7.1-cli, because the hosting server had many versions of PHP installed, and the default one is not even a command line interpreter.  I then created a bash alias in ~/.bash_profile for the drush script, so that I could run drush anywhere. 

    alias drush='/h/drupal/vendor/bin/drush --root=/h/drupal'

    With drush, migration was easy, with only a few commands.

    First initialized the database.

    drush si standard --db-url=mysql://username:[email protected]/newdb --root=/h/drupal --db-prefix=drupal_ --locale=en

    Now we found out all the modules enabled on the old site, and enabled them on the new site. 

    drush en migrate_upgrade migrate_tools migrate_plus rules config_update libraries tracker views_bulk_operations taxonomy_menu tagadelic mollom better_formats statistics pathauto mathjax profile

    Not all the old modules exist in Drupal 8 any more. Some of them are folded into core, and some simply disappeared. With above, we also enabled three modules needed for doing the migration.

    First created the migrate configurations.

    drush migrate-upgrade --legacy-db-url=mysql://username:[email protected]/olddb --legacy-root=http://yyhh.org --configure-only

    At this point, one could run individual migration one by one, or one could run them all, which I did:

    drush mi --all

    Most of the migrations worked. Two migrations failed with errors: 

    • upgrade_d6_filter_format

    "Missing filter plugin: filter_null.                        [error]"

    This error turned out not to be a problem. All one needed to do is to save the formats again at the UI: "/admin/config/content/formats". Otherwise, the content of the posts will not show due to missing filter "filter_null". Saving the formats in the UI got ride of the errors.

    • upgrade_d6_taxonomy_term_translation

    "Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'langcode' cannot be null:..."

    Basically, all the taxonomy terms failed to translate due to missing language code. Since all my terms are in English, this was not a problem either.

    Now the new site was up and running. The look of the site was of course horrible. I had to install a new theme and created a sub-theme. Then did all the work of creating views, blocks, and links with the UI. Now we have a functioning site. Cool!

    A few cautions though:

    • Do not enable "taxonomy_breadcrumb", otherwise the page will error out. I think it's because the migrated taxonomy terms miss some fields. I did not investigate further since I would not use it any more.
    • Do not enable "comment_notify", the migration may error out. I did not investigate since there's no need to migrate this.
    • No need to enable "blog". The functionality of blog module could be easily reproduced by creating one's own views. The "blog" module does not work well with migrated posts any way.

    An unsolved problem is that the "popular content" links are all out of whack due to the loss of all old statistics. This is a known issue that has not been resolved as of today. The fix, however, will be available in Drupal 8.5. So if the node counts are important to you, hold the migration until 8.5 is released on March 7, 2018.

    Overall, the upgrade is a smooth experience, in the sense that source code modification was not necessary, nor was changing the database data. I am glad the Drupal is getting better and better.

    Add new comment

    The content of this field is kept private and will not be shown publicly.
    About text formats
    Tweets by @yunyao_li
    Tweets by @huahaiy

    Popular content

    Today's:

    • Are you Han? My paternal ancestry - Hypothesis
    • My solutions for problems No. 76-100 on 4clojure.com
    • Reference to Individual Email Message in Plain Text File

    All time:

    • Easy Tuna Birthday Cake for the Cats
    • FreeIPA in AWS EC2
    • Are you Han? My paternal ancestry - Hypothesis
    • Ecobee3 installation with K wire
    • My solutions for the first 50 problems on 4clojure.com
    • Configure Jenkins to use FreeIPA LDAP Security Realm

    Recent comments

    • great!!!!
      3 months 3 weeks ago
    • I do have gas powered central Heat
      5 months ago
    • It's not just about Route53 settings
      5 months ago
    • Having issues installing ipa replica on an EC2 instance
      5 months ago
    • Thanks!!!
      5 months ago
    • Exact issue, not resolved. Please help!
      5 months ago
    • it's just really great to…
      1 year 1 month ago
    • Travel Tips
      1 year 2 months ago
    • I've found this interesting! with regard to Baby Strollers
      1 year 2 months ago
    • Love this!
      1 year 2 months ago

    Links

    • Recent content

    User account menu

    • Top 10 cats products
    • Log in
    • Pets
    • Linux
    • Software
    • Travel
    • Technology
    • Extraordinary
    • Shopping
    • Science
    • Clojure
    • Religion
    • Politics
    • Vim
    • Math
    • Psychology
    • House
    • China
    • Java
    • GTD
    • LaTeX
    • Society

    Footer menu

    • About
    • Archive
    • Contact
    • Huahai's Blog
    • Yunyao's Blog
    • A Math Game
    Copyright © 2019, yyhh.org.
    Unless stated otherwise, this site's content is licensed under creative commons Creative Commons License. There is no warranty of any kind, expressed or implied. We are not responsible for visitor comments.