Migration of Flag Lists from Drupal 7 to Drupal 8
Migrate from D7 to D8
There is now support in Flag Lists for migrating from Drupal 7 to Drupal 8. But due to that there, to my understanding, is no support for migration of flags in the Flag module which the Flag Lists is very dependent on, I recommend the following method for the migration.
- Install the following modules as this method uses Drush
- The core module Migrate
- Migrate Plus
- Migrate Tools
- And finally setup Drush
- Upgrade your core Drupal 7 site to Drupal 8. Make especially sure that the Node and User modules are migrated. Also please note among other things, the following pre-requisites.
- Install:
- Check if it is possible to migrate the flags in the Flag module. If possible, migrate them. It is however not necessary to have migrated them, for the following steps. The corresponding flaggings from the D7 Flag Lists module will be imported to the D8 Flag module in the last step.
- With this done you are ready to start the upgrade of the Flag Lists module.
- The following commands are the ones that are necessary for the migration. Note that the order is important! There are however a few things to keep in mind stated below under "Details of the upgrade".
$ drush migrate:import d7_flag_for_list $ drush migrate:import d7_flagging_collections $ drush migrate:import d7_flag_list_items $ drush migrate:import d7_flag_lists_flagging - That is it!
- You can now remove the Migrate Plus and Migrate Tools modules.
You will get some warnings, but as long as it is only warnings you are OK.
Details of the upgrade
The most troublesome is the first step:
drush migrate:import d7_flag_for_listIf you have added any own "Template flags" in D7 then you will get a lot of warnings. In all cases you will get the following warning due to that there is no support, yet, for migration in the Flag module.
[warning] The template flag "Flag lists template" wasn't found.
You will get the same warning when importing the Flagging Collections:
$ drush migrate:import d7_flagging_collections
[warning] The template flag "Flag lists template" wasn't found. Using fallback.
This is because the Template Flag has not been migrated. This is however handle gracefully by assigning the Drupal 8 default Flag list template instead, "Flag list template 1 ". If you have tweaked this, default one, in Drupal 7, you can do the same in Drupal 8.
For the next import command you shouldn't see any warning:
$ drush migrate:import d7_flag_list_items
However if you see something like this, you have probably a problem with your import of your Drupal 7 nodes into Drupal 8.
[error] The entity with ID "361" wasn't found.
For the last import command you shouldn't see anything either. But if you have problems with the previous these warnings will show up here as well.
$ drush migrate:import d7_flag_lists_flagging
If anything goes terribly wrong
All warnings are written to the Drupal log.You can check them there. The following two commands are great to use if you find that anything went wrong during any of the import steps.
$ drush migrate:rollback <The name of the migration you want to revert>
$ drush migrate:reset-status <The name of the migration you want to reset>The first one, rollback, revert the last import. If something crashes you might normally first have to use the reset-status command to abort the crashed session.
In absolutely worst case you also can do an uninstall / install cycle of the Flag Lists module. If you do this, don't forget to rollback all migrations you have already done!
$ drush pm-uninstall flag_lists
$ drush pm-enable flag_listsHelp improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion