Preparing for Upgrade
In my previous post, I described why I was upgrading a website from Drupal 6 to Drupal 8 and some of the key considerations. Note that many of these are likely required to upgrade from Drupal 7.
For this post, I will install the Drupal Migration Modules.
From Preparing an Upgrade I will check:
A fresh installation of Drupal 8 with the core module Migrate Drupal enabled.
Access to the Drupal 6 database and site files from the Drupal 8 site.
The Migrate Upgrade module installed and enabled on the Drupal 8 site. If you plan on running the upgrade from Drush, you’ll need Drush 8 and the module Migrate tools. Using Drush is more robust and allows selective migration. But it requires an additional module and it must be run from the command line.
Installing Drush 8 Locally
Executing an upgrade using Drush describes that the latest Drush needs to be used to upgrade - so lets’ get it.
I will install Drush using Homebrew package manager as described in Install Drush on a Mac I already have Homebrew installed, otherwise I followed the commands on Installing Drush on Mac using Homebrew
Issue - The above methods caused all kinds of errors on install and may not be the best way for Drush 8 or Drupal 8 as described at Installing Drush 8 using Composer
Before installing, I decided to change the default MAMP document folder to be in my usual /Sites/ folder :
The local URL now looked like this:
Drush was then installed with Composer using instruction at Install a global Drush via Composer :
Step 1 - Install Composer Globally
Step 2 - Add Composer to my bash_profile
Add the following line
Start a new Terminal session to ensure the path is updated
Step 3 - Install Drush using Composer and verify Status
Add the following lines:
Step 5 - Install the Migration Modules
Executing an upgrade using Drush describes:
To migrate using Drush you need to download and enable the Migrate Upgrade contributed module. You will also need Migrate Tools if you plan on doing more than running a one-time complete upgrade.
The first part worked:
Issue: Drush was not able to start (bootstrap) the Drupal database
If you are running your Drupal sites with MAMP, you need to tell Drush to use MAMP’s mysql.sock or you will run into the following error. Easiest way to do this is by creating a symlink
Now to retry..
Issue: Drush still could not connect with the same error as before - I determined that the mysql command was not available from /Users/hywel/Sites/drupal8 with MAMP Following the instructions at Solving mysql command not found” on MAMP
Add this line to .bash_profile:
Now to retry..
Success - Do you want to continue… yes I think so! See you next time.