This Tutorial will demonstrate the way to upgrade a Drupal 7 website to Drupal 8 by means of either using a local sandbox install with WAMP or remotely on a subdomain using phpMyAdmin. Drupal 8 Theme & Module versions have major compatibility issues.
The ease of translating a Drupal 7 website to a Drupal 8 codebase is determined by the compatibility of Themes & Modules. If your website has custom code in Themes or Modules, this will need to be upgraded by professionals to new Drupal 8 standards.
Let’s Get Started.
Drupal 7 to Drupal 8 Upgrade: Sandbox Environments.
In order that live sites do not lose any data or experience downtime, back the website files and database MySQL tables into copies using cPanel or other tools. Easiest is to select all of the files and folders for a Drupal install and pack them into a .zip file in cPanel.
Use the Backup & Migrate module or phpMyAdmin to export copies of the website database. Then choose one of the two methods below to create a sandbox environment for the upgrade.
Option One: Build Demo in Local Sandbox on WAMP.
The first option is to create a sandbox for the Drupal 8 upgrade work using WAMP on a local computer and then publish using Version Control or FTP. With WAMP, you are running a Windows Server with Apache, MySQL, & PHP installed on your desktop.
Settings:WAMP requires the Drupal 7/8 site files to be routed with a custom IP address to specific folders. Choose these values in WAMP administration & then unpack the Drupal 7/8 website files to the specific folder designated for the install.
Configuration: Import the MySQL database & change the settings in phpMyAdmin or by using a fresh Drupal installation with the Backup & Migrate module interface.
Professional: use Git, CVS, or Subversion to transfer Drupal upgrade code between servers.
Option Two: Clone Site Mirror to Sandbox Subdomain.
Easier for some users is to simply create a new subdomain in cPanel and then clone the Drupal 7 website files to the subdomain as a sandbox mirror. Use phpMyAdmin or the Backup & Migrate module to port database maps of the live site for testing.
Note: After the sandbox domain is established, the upgrade of the site & database from Drupal 7 to Drupal 8 will be done on these files, with the finished copy transferred to production after testing. This means no downtime for your clients & secure debugging before launch.
Drupal 7 to Drupal 8 Upgrade Process:
Step One: Identify All Installed Third-Party Modules.
Start: The first step to a successful Drupal 7 to Drupal 8 migration is to make a list of all the third-party modules installed that are not part of core.
Next: The second part of this is to research the availability of a Drupal 8 version of the Drupal 7 module. If the module is available, you can keep the functionality in the upgrade.
Note: If the modules you are using for a Drupal 7 site in production are not available for Drupal 8, plan to code around the missing pieces with new solutions.
Note: Many Drupal 7 website owners have not upgraded to Drupal 8 because of lack of module path support and the cost of conversion. Sites with significant custom code solutions must contend with lack of backward compatibility between platforms for modules & themes.
Hint: Save Database Backup versions of each stage of your site along the upgrade process, such as the original, the Drupal 7 version with no third-party modules, & the Drupal 8 version.
Step Two: Switch to a Base Theme.
Quick Links: Navigate to the Theme section and switch to the Bartik theme.
Note:Drupal 7 & Drupal 8 have radically different Theme standards, so you won’t be able to reuse files between the installs. Users with sub-themes based on popular frameworks like Zen or Twitter Bootstrap may find it easier to port custom code between platform versions.
Hint: Run the Drupal 8 upgrade script with Bartik as the base theme and then install new versions of Custom Themes after the database upgrade process is complete.
Step Three: Remove All Core Drupal 7 Files.
None of the Drupal 7 core, module, & theme files will remain with the Drupal 8 upgrade. Similarly, you won’t be able to port modules or themes from third-party developers.
Summary: There is no backwards compatibility between Drupal 8 & Drupal 7.
Note: Go to your Drupal 7 codebase & remain all of the core files with the exception of settings.php & the image cache files.
Step Four: Remove All Third-Party Module & Theme Files.
For the final step, go ahead and remove all of the modules & themes in the Drupal 7 sites/all & sites/default folders. There should be no Drupal 7 files other than settings.php & image cache.
Hint: Port any code changes from the Drupal 7 .htaccess to the Drupal 8 version manually.
Note: After all of the Drupal 7 files are deleted, port the database and user login information from the settings.php to the Drupal 8 version manually.
Next: Restart the website for the Drupal 8 platform version upgrade.
Step Five: Add Drupal 8 Files & Run the Upgrade Script.
After the Drupal 7 files are deleted upload and unzip the Drupal 8 core package. Switch the settings.php file on Drupal 8 to the edited version with the Drupal 7 configuration settings.
Note: The /update.php script will run the upgrade to Drupal 8 according to the last saved settings for Modules & Themes on the database. After the upgrade script has run, begin rebuilding the Drupal 8 to replace the uninstalled versions of modules with new scripts.
Hint: Websites with custom Themes & Modules may have more difficulty replacing their functionality due to the major requirement changes in Drupal 8. Contact the programming & development team with maintenance plans for CI/CD on Drupal 8 platform upgrades.
Step Five: Reinstall Drupal 8 Versions Of Modules & Themes.
Next: From the list you created above, reinstall the Drupal 8 versions of the modules that are available for your site which had been in use on the Drupal 7 version. Turn the new modules on one by one and test their functionality in the base theme. Keep a running list of issues & bugs.
Hint: Make a list of unsupported Modules and keep that as a separate thread from bug-fixes in a project management application that manages the Drupal 7 functionality.
Hint: Make sure to target working Drupal 8 solutions that replicate & replace the lost functionality seamlessly by rolling out site upgrade & platform version features.
Note: If this method fails, install a new version of Drupal 8, then import the Drupal 7 database through the Backup & Migrate module. Run update.php & re-install the modules.
Using the Migrate Module:
Installation: Enable the Migrate module & two experimental modules for Migration. Then navigate to: /upgrade
Note: To increase compatibility, install the Drupal 8 site on the same database/password as the Drupal 7 site with different table prefixes. Then run the Migrate module.
Note: Using the Migrate module & /upgrade path, you can import your Drupal 7 database to a new Drupal 8 website codebase. Then reinstall the required Modules & Themes.
Complete!: If either of these methods fails, use the Migrate module on a clean Drupal 8 installation, and import your database directly from Drupal 7 using the /upgrade path fields.
Step Six: Test the Upgraded Site & Fix Theme Bugs.
The next step is to use the sandbox environment to fix the bugs in the theme & module functionality that needs to be patched after the Drupal 8 upgrade. This depends site-to-site individually depending on the code & what modules were installed previously.
Hint: Use a project management applications like Basecamp, Trello, & Slack to keep running lists of known bugs and issues that need to be fixed. Keep track of issues reported by users.
Configuration: You can change these values in the settings.php file to test update versions:
$databases = array ( 'default' => array ( 'default' => array ( 'database' => 'blackhost_abc101', 'username' => 'blackhost_xyz101', 'password' => '1234567890', 'host' => 'localhost', 'port' => '', 'driver' => 'mysql', 'prefix' => 'drup_', ), ), );
Finish: Do a through cross-browser testing of the website in Chrome, Safari, Explorer, & Firefox to make sure your new Drupal 8 site works across all devices & displays.
Step Seven: Port the Database & Site Files to Production.
Going Live with Changes: After the sandbox website has been upgraded, bug-fixed, & theme tested across browser versions, you can port the site files and database to the live production site to launch the upgrade. Take the old site offline in Maintenance Mode.
Delete all of the files on the production site after backing them up, along with the database. Then install the upgraded version of the Drupal 8 by unpacking the files and importing the MySQL database either through phpMyAdmin or the Backup & Restore module.
Hint: Busy sites will need to synchronize any database changes such as new users, password changes, or ecommerce orders between the sandbox version and upgrade version.
Professional: Use your favorite programming utilities & version control tools.
Conclusion: Significant Issues & Development Challenges.
Summary: Updating a Drupal 7 site to Drupal 8 is a very difficult task for complex websites with large databases of content & users that have many third-party modules installed. The lack of platform compatibility between Drupal 7 modules and Drupal 8 versions is severe. Similarly, there is no smooth upgrade path for themes, making recoding a necessity.
Recommendations: Many website owners have put off a Drupal 7 upgrade because of compatibility issues but it does not look like the ecosystem will be as diverse on Drupal 8.
Check out these top 3 Drupal hosting services: