Website migration is an important topic that we’ve already covered from a broader perspective in another article. In this blog post, we’ll focus on a specific example. We’ll look at the migration of WordPress, the most popular content management system, to Drupal. We’ll examine the benefits of such a migration, how it works, and how we should prepare for it.
Why migrate WordPress site to Drupal?
Migrating WordPress site to Drupal can be beneficial in many situations for the sake of the benefits of the CMS with a blue drop in the logo. With more advanced configuration capabilities, Drupal allows for more complete control over content structure and functionalities, which is especially useful for projects requiring specialized solutions. Here are some benefits for which we should consider such a WordPress migration.
An extensive ecosystem of components
Based on Symfony, Drupal enables us to create powerful features in a simple, fast, and clear way. Thanks to full objectivity, imposed design patterns, and the use of components from this PHP framework, project development and maintenance are easier. A rich ecosystem of ready-made solutions drives efficiency and saves time.
In addition, Drupal gives us many contributed modules created by the community. Even for unusual business needs, there is a good chance that developers centered around this technology have already created a module solution. The Drupal community also deserves praise for its willingness to provide support and share knowledge. Patches for such custom needs are sometimes made for modules, which are introduced with updates over time.
Source: Drupal.org
Security and access control
If security is a crucial component of the project, Drupal can be a reliable and proven option with better options for managing data access and frequent security updates. Access control for sensitive data is provided by default in Drupal, which is essential for websites storing sensitive information.
In addition, when creating routings or views, we can define precisely who will have access to them. Everything from entire pages and functionalities to individual fields or values that can be selected in a field, we can control with appropriate roles and permissions from the UI.
Performance and scalability
Drupal, especially in its latest versions, is optimized for performance and can effectively handle large amounts of content and high traffic. When we plan to expand our website and need scalability, Drupal can handle the growing load better than WordPress.
This system also works well as a backend API. Thanks to built-in functions, we can easily share all the data by passing it in JSON/XML form without going into writing custom logic. This opens up a wide range of possibilities for integration with mobile apps, frontend frameworks, and other tools.
Content management for large websites
For projects with lots of content and complex structures, Drupal offers advanced content management tools. Ready-made entities, such as content types or groups, allow us to logically organize content on our website. The ease and flexibility of categorizing is one of Drupal’s main advantages.
We get not only the ability to act on entities but also to shape them freely. Inserting additional fields, creating relationships between them, and different display options depending on where they are used are just some of the benefits. For example, a view that lists a specific type of content for us, along with advanced filtering and sorting, is clickable in the UI in just a few moments without touching the code.
Customizable administrative interface
If customization of the administrative interface to meet specific needs is essential, Drupal allows advanced modifications and customization. This will be extremely helpful for projects requiring a detailed layout of the admin panel, a specific look, or permissions.
We can add new blocks with valuable links or statistics, create new views that list specific entities for us based on our own conditions, and then modify the links by adding such a view to an existing or new menu. We can also personalize the look of the admin panel using already ready-made skins, as well as our own styles.
There is also an option to add shortcuts for quick access to frequently used functions.
Another essential advantage is access control, which enables us to precisely manage user permissions to the admin panel. For example, if we don’t want a content editor to have access to API integration settings or change Cron jobs.
WordPress to Drupal migration — how does the process work?
We’ve prepared some key steps for migrating from WordPress to Drupal based on our developers’ experience. While the specifics of websites may vary, the migration process is usually the same and acts similarly. There is a certain universality in the migration approach, making it more predictable and schematic for most projects.
Preparing for WordPress migration
Before we start the migration, we need to consider in what form we’ll provide the data from the previous website. In most cases, we’ll need an XML file for this, which is generated from WordPress as a backup.
Our first step is to precisely determine what we’ll migrate and where. We’ll try to review the previous website to ensure that what we’re moving is necessary. Let’s remember that less sometimes means more. For example, we may no longer need news from 2009 on our new web page. We wrote more about the planning stage in our previous article on website migration.
Configuring Drupal before you migrate WordPress
On the target environment, we prepare the data structure where we’ll store the migrated data. After prior planning, we should know which content to use taxonomies or groups for and which content will need custom entities.
We want this website to be ready before we start the actual migration. It’s also necessary to install the Migrate Plus and CTools modules and WordPress Migrate. It’s a good idea, too, to implement the planned modules that will be needed for the target website. Examples include Datetime or Telephone, which will add a corresponding widget for the text field. This will definitely come in handy during data migration.
WordPress content migration
We always start data migration by gathering information. Data is moved from one source to another, and our job is to arrange it into appropriate entities.
In the case of WordPress, it’ll be best to use an XML file exported from the old website for this. Here we can use the previously mentioned WP Migrate module, which will do some work for us. It’ll move categories, blog posts, or content pages. Anything this module doesn’t do automatically, we’ll have to migrate manually by writing our migrations using YML files and migration plugins.
Migrating a website to Drupal consists of three stages:
- data download,
- data processing,
- data storage.
In the first one, we need to retrieve data from a source, such as an SQL database or an XML file in its complete form. For example, it could be a blog article with a title, content, author, graphic information, etc. In the next step, we “tell Drupal” what message should be passed to which field.
This is also an excellent time to organize the website during the migration. We often find that it has a lot of unnecessary data that we don’t need to move. These can be omitted altogether or changed during the process and adapted to our new needs. At the last stage of data storage, we create an entry in Drupal as a specific entity.
Notably, the content migration can be divided into many smaller migrations. Instead of one extensive process, we can migrate only users first, then taxonomies and images, and only at the end — specific content types and possibly custom entities.
This approach gives us the ability to easily create relationships between entities already during the migration, since other migration processes can be referenced while the data is being processed. At Droptica, we prefer this form of website migration because we don’t have to worry about losing data, and the process becomes more organized.
Website owners sometimes also care about changing the URL structure for given entities. In this case, appropriate redirects are necessary to protect the website’s SEO interests. It’s worthwhile already when performing the migration to ensure that the Pathauto module has the required schemes set up.
WordPress migration testing
Once we have the data ready, it’ll be good practice to test it thoroughly. It’s worth spending some time on automated tests to thoroughly check all the content. If it turns out that the data doesn’t match in terms of content or quantity, that’s a sign for us to make the necessary adjustments to the migration plugins.
Using the right content gives us a significant advantage. If we used test content, we might not notice substantial problems. Unexpected errors may appear on user content, which is better solved at this stage. Eliminating edge cases only during development is unfortunately not always possible.
When we also had our own entity in WordPress and had to change or process this data, special attention should be paid to testing such content.
Migrating functionalities from WordPress to Drupal
When it comes to functionality migration, we need to lean for a while longer on the business logic layout. In the case of WordPress, we can even have individual PHP files written inside the CMS.
The modules/plugins provided by the community are also completely different. It’s often the case that a problem that in the old system required several plugins (often paid) and additional custom code can be easily “fixed” in Drupal in the form of a contributed module or functionality that is already in the core of the CMS.
At this stage, we have to decide which way to go. We write custom modules, configure or change those provided by the community, and constantly check with the previous website to make sure we are definitely going in the right direction.
Of course, there may be times when we modify these functionalities, add new ones, or remove those that are no longer needed. Migration to a new website is a great time for such cleanup. We are then operating on a web page that is not yet visible in production and not used by users.
Verifying ready WordPress to Drupal migration
Once the migration process is complete, we focus on key aspects to ensure the new website runs smoothly and aligns with our expectations. Here are some steps to follow.
Integrations with external services and APIs
We make sure that any integrations with external services are correctly configured, work as previously agreed, or are adapted to new requirements. We also primarily verify that API connections are working without problems.
Content and media control
We verify that the content on the new website is consistent with the original data. It’s also essential to check that images, videos, and other media are displayed properly. We ensure there is no lost data and that all content has been appropriately transferred from WordPress.
Monitoring of errors and logs
During testing, we regularly check Watchdog (a system for logging activity and errors within Drupal) for any post-migration errors. We also check for unexpected error messages from, for example, PHP when browsing the website.
SEO and page load speed optimization
We check that Drupal’s SEO modules are configured correctly, and we monitor the page speed and adjust it if necessary by, for example, aggregating styles and JavaScript.
Testing functionality and permissions
We test the most important functionalities of the website, especially those related to user interaction. We make sure that all content permissions have been properly configured.
Responsiveness and device compatibility
We verify that the website is responsive and displays correctly on different screens after the migration. We confirm that the frontend works as expected on all devices used. We remember to look at all sensitive functionalities, such as forms or tables, which may have particular problems on narrower screens.
Quality audit and testing
We conduct a quality website audit. Tools such as CodeSniffer and PHP Stan will help us with this. We also ensure the web page goes through the automated testing process (Codeception) and is integrated into our pipeline.
Reproduction of the entire functional process
As part of the migration from WordPress to Drupal, the final step is to precisely recreate the entire functional process or processes. Rather than limiting ourselves to specific functions, we focus on ensuring the continuity of the user experience through a comprehensive flow that we define in the test scenario.
For example, it could be going through the entire form to register a new user, assign permissions, and adjust assigned roles and access levels to reflect previous structures. We can also focus on the process of creating new content. We take care to maintain compatibility with the structure and content types of the prior system, enabling a smooth transition for administrators and end users.
Reproducing the entire functional process not only ensures that the various elements work correctly. It’s essential to go through scenarios consisting of functionalities not included in Drupal core but explicitly written for the website. Often, these are key elements of business logic, and we need to be sure that all essential functions will work perfectly after their implementation. Finally, we don’t want to get hundreds of emails from users that something isn’t working after the migration.
WordPress to Drupal migration — summary
Migrating WordPress to Drupal is a complex process justified by various factors. One CMS may be chosen over another due to advanced configuration capabilities, better security, access control, performance, and scalability.
During the migration, it’s worthwhile to customize the new web page and its functionalities to meet specific needs and optimize URL structure or design. By focusing on a quality audit, automated testing, error monitoring, and adjusting responsiveness, we can ensure a smooth website implementation.
Moving a WordPress site to Drupal is a complex process that requires planning, diligence, and testing. If you’re considering transferring your web page or need support on this topic, you can count on our help. We specialize in Drupal migration to higher versions and from other CMS systems.
Originally published at https://www.droptica.com.