Affordable websites packaged for small businesses

Migrating from Drupal 7 to Backdrop CMS

We've been upgrading a few of our client's Drupal 7 sites to Backdrop CMS recently (read why here), so we thought we'd share with you the process we're using. The official Backdrop instructions can be found on the 'Upgrading from Drupal 7' page; ours are based on those instructions, but with some changes that we find fit better with our workflow.

Preparation

  1. Categorise D7 modules
    The first step is to get a list of all the D7 modules installed on the site (we just run 'ls -1' from the 'modules' directory on the server) and then go through and categorise each one based on the following criteria:
    • Uninstall: the functionality is no longer required, this module will be completely removed.
    • Core: the functionality has been added to Backdrop core, Backdrop will perform the necessary updates.
      See Backdrop's 'Features added to core' page.
    • Contrib: the module has been ported to Backdrop contrib, the Backdrop module will perform the necessary updates.
      Seach the list of modules for Backdrop.
    • Replaced: a different Backdrop module provides the same/similar functionality, the Drupal module will be completely removed.
      We use this category when, for example, a Drupal site uses a module we'd prefer to replace with a different one (e.g. Colorbox -> Featherlight). Be sure to note the module that's replacing it.
    • Port: the module needs to be ported to Backdrop, the new Backdrop module will perform the necessary updates.
    • Install: new module/functionality is needed in Backdrop.
      This is useful if a Drupal module was split into seperate Backdrop modules when ported (e.g. Date -> main functionality in core, Date Tools, Date All Day).
  2. Prevent edits to Drupal site
    Discuss the migration process with the client and explain that, ideally, the current Drupal site will stay online during the migration period, but that no changes should be made to it (to prevent the migrated Backdrop site being out-of-date before it even launches). If the website is small with only one or two admins/editors, they can just agree not to make any changes. But if the site has lots of people with editorial access, or has forms that visitors can use to enter information (e.g. registration forms, etc.), then we recommend installing the Read Only Mode module - it allows a website to stay live and working, but without allowing edits/changes to the content.
  3. First backup
    Make a full backup of the Drupal site (database, files directory, modules, themes, etc.), name it something like 'Drupal 7 backup' and store it away safely. This backup is of the Drupal site as it was before any changes were made, and will be used later to restore the working copy of the site that will stay live during the actual migration.
  4. Take site offline
    Put the site into 'maintenance' mode and disable the client's permission to access the site while offline.
  5. 'Uninstalled' modules
    Disable and uninstall all modules in the 'Uninstall' category. Then delete them from the filesystem.
  6. 'Replaced' modules
    Disable and uninstall all modules in the 'Replaced' category. Then delete them from the filesystem.
  7. 'Ported' modules
    Disable, but don't uninstall, all modules in the 'Port' category. Leave them in the filesystem.
  8. Update Drupal
    Make sure Drupal 7 core is updated to the most recent version.
  9. Update modules
    Make sure all remaining modules are updated to their most recent version.
  10. Reset themes
    Change the default theme back to 'Bartik' and the admin theme back to 'Seven'.
  11. 'Core' modules
    Delete all modules in the 'Core' category from the filesystem. Don't disable or uninstall them.
  12. 'Contrib' modules
    Delete all modules in the 'Contrib' category from the filesystem. Don't disable or uninstall them.
  13. Libraries
    Delete the 'libraries' directory from the filesystem (Backdrop bundles third-party libraries with their modules).
  14. Second backup
    Make another full backup of the Drupal site, name it something like 'Migration backup' and store it away safely. This backup will be used in the Backdrop migration.
  15. Restore first backup
    Restore the first 'Drupal 7' backup you made in step 3. This will undo all of the migration changes you made to the Drupal site so that it can stay online and working while you perform the actual upgrade.

Upgrade

  1. Install Backdrop
    Setup a new Backdrop website: download and extract Backdrop to your server, setup a database, configure 'settings.php', then run the installer. This will give us a place to import our Drupal backup, and lets us know Backdrop works properly before continuing. Don't bother with the configuration/settings too much as this'll all be replaced by the migration backup soon.
  2. 'Ported' modules
    Download the latest Backdrop version of all modules in the 'Port' category. Don't enable them.
  3. 'Replaced' modules
    Download the latest Backdrop version of all modules in the 'Replaced' category (the Backdrop modules, not the old Drupal ones). Don't enable them.
  4. 'Installed' modules
    Download the latest Backdrop version of all modules in the 'Install' category. Don't enable them.
  5. Config
    Delete everything in Backdrop's 'active' config directory.
  6. 'Files' directory
    Replace everything in the 'files' directory (except 'config') with those from the 'Migration' backup.
  7. Database
    Replace the Backdrop database with the one from the 'Migration' backup.
  8. Update.php
    Run Backdrop's 'update.php' script (/core/update.php). This will officially upgrade the Drupal site/database to Backdrop!
  9. 'Replaced' modules
    Enable all Backdrop modules in the 'Replaced' category.
  10. 'Installed' modules
    Enable all Backdrop modules in the 'Install' category.
  11. Test and configure
    Test to make sure there are no major issues so far. Go through and configure Backdrop to work the way you'd like (e.g. setup the 'Replaced' modules to work similar to their Drupal counterparts, setup the 'Installed' modules, etc.).
  12. Layouts
    Create and configure layouts to match the way the Drupal site was displayed.
  13. Theme(s)
    Install and/or port the theme(s) you want to use in Backdrop.
  14. 'Ported' modules
    Port to Backdrop all modules in the 'Port' category. Ideally contribute them back to the Backdrop community with an upgrade path from Drupal.
  15. Go live!
    Do a final test of everything, then make the necessary changes to your server/DNS to take the Backdrop site live!

 

If at any point after step 8 of the 'Upgrade' process you need to redo the upgrade itself (i.e. 'update.php'), first export all 'active' config to 'staging', then you can re-import it later without losing any changes you might have made.

Finally, these instructions have been working for us so far, but we might make changes to them in future as we perform more of these upgrades, discover bugs or more efficient methods, etc. 'Your mileage may vary', so make constant backups and let us know how it goes for you.

Add comment