Aug 08 2019
Aug 08

With Dries’ latest announcement on the launch of Drupal 9 in 2020, enterprises are in an urgent need to upgrade from Drupal 7 and 8 to version 9.

Drupal 7 and 8 will reach their end of life in November 2021, and those who wish to stick to previous versions might possibly face security challenges.

Eager but unsure what the process would be like? This comprehensive guide aims to simplify the entire Drupal migration process for easy implementation.

Getting Started with the Migration Process

When site is upgraded to Drupal 7, the old database is upgraded to Drupal 7 structure. However, a different approach is followed when the site is upgraded from Drupal 7 to Drupal 8.

Upgrading D7 to D8

Step 1: Take back-up of your website

Start the migration process by making a local copy of your website. As making changes to live site is not recommended, it is a best practice to keep all data safe by taking a backup locally on your machine.

Step 2: Install fresh new site

Install a new Drupal 8 site by downloading the latest version of Drupal 8 from drupal.org.

Drupal 8.7 is the latest release.

Install the latest release of Drupal 8 along with installing dependencies with Composer.

Step 3: Prepare your Drupal 8 website for the migration

Setup a local Drupal 8 website on your machine as a destination website for the migration process.

Step 4: Verifying the modules are in core and enabled

Ensure Migrate, Migrate Drupal and Migrate Drupal UI modules are enabled on your Drupal 8 site. This can be done by navigating to the ‘Extend’ tab of your website and ensuring all the above modules are present in the core.

Now, check the three modules and click ‘Install’ button at the bottom of the page.

1-526074867869569243

 

Step 5: Upgrade your website

Go to your website and append the website address with /upgrade (www.<yourwebsitename>.com/upgrade) and follow the instructions. Now click ‘Continue’ button.

2-10

Step 6: Enter website details

On clicking ‘Continue’ the below screen comes up which asks you for the website credentials, database location and other details.

4-2

 

Step 7: Start the migration

If the database credentials to your source database are correct, the upgrade review page will appear on the Migrate UI. It will show the summary of the upgrade status for all installed modules on the old site.

As a site builder you should carefully review the modules that will not be upgraded and evaluate if your Drupal 8 site will work without the module.

click on ‘Perform Upgrade’ button.

Tip: Don’t proceed and perform the actual upgrade without first installing the missing Drupal 8 module.

Tip: If you get ID conflict warnings

If you manually create a node to the Drupal 8 site before upgrading and the source Drupal 6/7 site has a node with the same ID, the migration system will overwrite the node that was manually created in Drupal 8.

If conflicting IDs are detected, a warning about conflicting IDs will be shown which can be ignored to risk losing data or abort and take an alternative approach.

Depending on the size and types of content/configuration on the source site, the upgrade may take a very long time. Once the process is finished, you are directed to the site's frontpage with messages summarizing the results:

Upgrading D8 to D9

When it comes to migrating to Drupal 9 from Drupal 8, process is quite simpler. As D9 is an extended version of D8, it is much easier to upgrade. Read the complete guide of Drupal 8 to Drupal 9 upgrade to understand the complete process.

Alternate Method: Migration using Drush Command

Upgrading to Drupal 8 using Drush is useful when migrating complex sites as it allows you to run migrations one by one and it allows rollbacks.

If you are using Composer to build your Drupal 8 site, then you may already have Drush installed. However, if not, then you can install Drush from command line as follows:

composer require drush/drush

To migrate using Drush you need to download and enable the contributed modules: Migrate Upgrade, Migrate Plus and Migrate Tools.

Ensure the Drush is up to date (with the command: “drush –version”)

Now it’s time to start the migration through Drush with following drush command

“drush ://user:[email protected]/db — ://example.com –configure-only”

Where the below mentioned values can be with your values in the above command

  • ‘user’ is the username of the source database
  • ‘password’ is the source database user’s password
  • ‘server’ is the source database server
  • ‘db’ is the source database

Now check your migration status (with the command “drush migrate-status”)

Import the data with the command (“drush migrate-import –all”).

After successful migration, go to the structure->migrations to check the status of migration.

5-1

Check the list migration button next to the migration group ‘import from drupal 7’ to view the entire migrated data.

 

6-590

 

After clicking on all upgraded data will be visible. Click to the execute button and data will be imported.

7-2

 

Once you click on the execute button, you will be redirected to the page with below mentioned options.

8-2

Import button imports all previously unprocessed records from the source into destination Drupal objects.

With this we come to an end of our Drupal migration process. If the above steps are followed carefully, a website can be easily migrated to the latest version.

Srijan has more than 35 Acquia certified Drupal experts with expertise in migrating projects to newer versions of Drupal. Contact us to seamlessly get started with the latest Drupal version.

 

May 19 2019
May 19

While upgrading to the latest version is always part of the best practice, the process can be staggering.

Drupal 8.7 is already here and 9 will be released in a year, in June 2020.

Although a lot of discussion is happening around the upgrade and possibilities it brings along, the final product can only be as good as the process itself.

The good and important news is that moving from Drupal 8 to Drupal 9 should be really easy — radically easier than migrating from Drupal 7 to Drupal 8.

As a site owner, here’s what you need to know about the new release and what to take care of to make the process easier without many glitches.

The Drupal 9 Release and Timeline

The goal of Drupal 9 is to make it an easy upgrade as much as feasible from Drupal 8. Unlike most of the previous upgrades, D9 will be different in terms of:

  • Updates of dependencies to versions that stay supported.
  • Removal of our own code that we deprecated with removal before Drupal 9's release.

The new release will be a cleaned-up version of Drupal 8. Built on the same code base with deprecated code removed and third-party dependencies updated, Drupal 9 is not a reinvention of Drupal.

a horizontol table with Drupal versions

The next question is what happens to Drupal 7 and 8, then?

One of the major dependencies of Drupal 8 is on Symfony 3. Since Symfony 3 enters the end of life in November 2021, Drupal 8 support will be lifted around the same time. A long-term-support (LTS) minor release of Drupal 8 will be released alongside Drupal 9 and supported until November 2021.

No new features will be added to Drupal 8 and no new minor releases will be made available of Drupal 8. It will only receive patch releases after which.

Drupal 7 will also stop receiving community support after November 2021.

Data migration features in Drupal core to move from Drupal 7 to Drupal 9 will be active until then since they are required for a stable migration. 

The Upgrade and The Tips

The only caveat is that you need to manage is the "deprecated code". Here’s what you need to take note of, for an easiest upgrade experience to Drupal 9:

Text on left with a blue table in centre and left

  1. Keep Core Up-to-Date: As mentioned above, Drupal 9 is Drupal 8.9 - deprecated parts plus dependencies updated.

    If your site doesn't use deprecated code that is scheduled for removal in Drupal 9, your upgrade to Drupal 9 will be easy. In fact, it should be as easy as a minor version upgrade (like upgrading from Drupal 8.6 to Drupal 8.7).

  2. Keep Modules Up-to-Date: Although Drupal 9 will not have new features (other than those provided by updated dependencies). While most modules will improve Drupal 9 compatibility, to ensure you don’t lose them in the upgrade, keep them updated.

    The key benefit of Drupal 9 over previous versions is that the platform will be supported with security fixes much later after support is lifted from 8. For contributed modules, the pace of Drupal 9 updates will depend on the module maintainers.

  3. Check Custom Codes for Deprecation: In case of any custom code on the site, you can use the deprecation checking and correction tools and fix issues locally. Tools you can use to check code depreciation:
    1. Drupal Check (read more her about PHP version compatibility check
    2. Rector (Read more about Rector here)

      Further, you can also use an IDE or code editor that understands deprecations (@deprecated annotations particularly) or Drupal 8’s branch of Upgrade Status for full site reporting.

What is Deprecated Code?

Deprecated code is referred to as the functions and API’s which are being replaced with new and better versions. In the journey from Drupal 8 from Drupal 9, you will experience API changes, with the new implementation is already present in core along with older one. We have to replace older code/API usage with the new.

Here is an example of the deprecated function:

* @deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. * Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead. */ function drupal_set_message($message = NULL, $type = 'status', $repeat = FALSE) { @trigger_error('drupal_set_message() is deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead. See https://www.drupal.org/node/2774931', E_USER_DEPRECATED); $messenger = \Drupal::messenger(); if (isset($message)) { $messenger->addMessage($message, $type, $repeat); } return $messenger->all(); }

In above example the function drupal_set_message is deprecated and has to be replaced with:

\Drupal\Core\Messenger\MessengerInterface::addMessage()

Ways to Find and Fix Deprecated Code in your Drupal Project

As mentioned above , you can find and fix your deprecated code in the following ways:

  1. Drupal Check: It's a library developed by Matt Glaman. Check the git code here. For installation and usage, you can refer to the readme. 
    In case you want to install using Composer, prepare using composer global require mglaman/drupal-check. You can also read more about the composer check
    1. Get into your project/Drupal root directory
    2. Choose the module you want to check for deprecations
    3. Run drupal-check --help for help items. Here, I am using watchdog_prune module for demonstration.
      run : drupal-check -d watchdog_prune
      The output will be something similar to the image shared below:

      deprecated-code-1-srijan

    4. You will, now, have the report of deprecated code to fix.
    5. Let say it is giving us File src/Form/WatchdogPruneSettings.php containing issue : Call to deprecated function drupal_set_message(). In this case just navigate to the body of function as in this case drupal_set_message()

      You will notice that the the documentation under red box reads that the function is deprecated and what we need to do instead
       
       

      Now replace the current code with the recommendation and you are done.

  2. Drupal Upgrade Status Module: This module checks the list of projects you have installed and shows their availability for newer versions of Drupal core.
    1. Use the Upgrade Status module form
    2. Download and install module using composer: composer require drupal/upgrade_status
    3. Install the module and navigate to URL using admin user: /admin/reports/upgrade
    4. You can run a complete project/ individual module scan
    5. Fix the deprecated code in the same way as mentioned above.

Wrapping Up

Because Drupal 9 is an extended version of Drupal 8, for site owners, this means that it should be much easier to upgrade. But keeping custom codes and module updated needs to be meticulously planned.

Have questions around Drupal 9 upgrade and how it might impact your site? Experts at Srijan are all ears, connect with us to chalk out the right course to Drupal 9.

Dec 18 2018
Dec 18

Drupal 9 is all set to release in June 2020, and brings with it end-of-life announcements for Drupal 7 and 8.

Drupal 9_ What’s in Store and How that Impacts Drupal Users

Source: Drupal 7, 8 and 9

While historically every new Drupal release has been evaluated in terms of all the new features being introduced, Drupal 9 is a bit of a break with tradition. If Drupal 8 represented a complete makeover of the technology, Drupal 9 is more a makeover of how a major Drupal release is rolled out.

So we take a look at what’s on the cards with Drupal 9, and have our Drupal experts weigh in on what that means for developers and site owners.

What's New With Drupal 9

Dries’ latest post “Plan for Drupal 9” says the big deal with Drupal 9 is that it shouldn’t be a big deal. And that thinking is exactly what is new.

Building With Drupal 8

Drupal 9 is not being built on a new core but rather within Drupal 8. New features and functionalities will be added to D8 as backward-compatible code. These will start being available to D8 users as experimental features, that can be used and modified for the better. All this while, older D8 features will work without a hitch.

Once these new features are stable, their older counterparts will be deprecated. And finally, the complete collection of these stable new features will be Drupal 9.

Ravindra Singh, Senior Drupal Architect at Srijan, thinks this approach is going to make life easier for Drupal users and developers. “Because everything new that makes up Drupal 9 will emerge out of existing Drupal 8, the final result will feel more like a minor version release rather than a ground-breaking all-new thing. And that’s good because it means less upheaval in the lives of Drupal users and developers. There will not be a huge learning curve for Drupalers to master D9, as was the case with D8. Most importantly, there won’t be a massive backlog of changes to be made to existing D8 sites, for them to remain functional with D9. All you need to do to make the migration easier and faster is to keep your Drupal 8 site abreast with all new updates."

The Migration Path - Drupal 8 to 9

The fact that Drupal 9 will not feel brand new also means that the upgrade from 8 to 9 will be super smooth.

Ritesh Gurung, our Senior Solutions Architect says, “Drupal developers working with D8 will have a chance to explore D9 features right from the start, and begin to upgrade any core or contributed modules. But the greatest benefit will be for Drupal site owners, specifically D8 sites. Those who have kept up with using the latest themes and modules, running on the updated D8 APIs, will have no trouble upgrading to D9.”

Highlighting how all Drupal releases are a community affair, Ritesh said, “Besides the volunteers working dedicatedly on Drupal 9, everybody else who gets to start using the experimental modules will be able to identify and help resolve any bugs and errors during the transition phase.”

Migrating from Drupal 7 to Drupal 9

As per the plans shared by Dries during Drupal Europe, both Drupal 7 and Drupal 8 will be end-of-life in 2021. Now if you are still on Drupal 7, you have two choices:

  • Continue with Drupal 7 till 2020, and then plan your migration to Drupal 9 in 2021

  • Migrate for D7 to D8, and then to D9, between 2019 to 2021

Now a direct migration from D7 to D9 seems like the best, and most cost effective path - why have two migrations when you can have just one.

However in this case, doing two migration might actually be a more practical option.

Ishan Mahajan, currently leading our large-scale Drupal project with Crain Communications, explains how:

  • Choosing to continue with Drupal 7 till 2020 doesn’t mean there’s no upgrade work coming your way. Drupal will likely release some more updates to D7 till it’s end-of-life. So there will be time and efforts invested to ensure your site keeps up with those.

  • Given the fact that D8 is now well advanced, with stable upgrade paths for almost all modules, you can move from D7 to D8 without giving up on any major site features or functionalities

  • Because D9 will be completely backward-compatible with D8, the final upgrade from D8 to D9 will not be as expensive or disruptive as you are expecting it to be.

So if you are still on D7, the announcement of D9 should be another reason to move to D8 as soon as possible. This will ensure you can move easily to D9 when it releases.

And for enterprises already running multiple sites on D8, Ishan says it’s important to “Make sure that the sites are always on the latest D8 version as well as ensure that no deprecated module or API is used. That way, these sites will be ready of Drupal 9.”

So there you have it, Drupal 9 - a major Drupal release that’s being designed to be as minimally disruptive as possible.

Have more questions about Drupal 9 features and how it might impact your site? Already chalking out an upgrade plan? Our team of Drupal experts, and range of Drupal development services, are ready to help.

Just drop us a line, and get the conversation started.

Srijan is Signature Supporting Partner to the Drupal Association. With 140+ seasoned Drupalers of which 56+ are Acquia Certified, Srijan has the largest team of Drupal experts in Asia. Srijan is also featured as Best Drupal Agency 2019 by Design Rush

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web