Problem/Motivation
As of 2022-12-27 / google_analytics-4.0.2 (there are a bunch of migrate issues!), I can confirm that this module properly migrates my Google Analytics module data from Drupal 7 to Drupal 9. Thank you very much for your hard work to make this easy for me!
But as of Drupal core 8.8.x, modules can declare their Drupal 8 (or 9) upgrade status (changelog, issue #2936365: Migrate UI - allow modules to declare the state of their migrations). Failing to do so makes it seem as if this module has no migrations and/or is not ready to be upgraded... for example, see the following image...

... this could be a barrier preventing other people from upgrading their sites to Drupal 8/9/10+.
Steps to reproduce
- Set up a Drupal 7 site. Download and install
google_analytics-7.x-2.6, and change some settings. - Set up a Drupal 9 site with the Standard install profile. Download and install
google_analytics-4.0.2. Enable core'smigrate,migrate_drupal, andmigrate_drupal_uimodules. - As an administrator, visit
/upgradeto begin the Drupal-to-Drupal migration. Proceed through the wizard to the "What will be upgraded?" step.- Expected behaviour: "Google Analytics" is in the "Modules that will be upgraded" section.
- Actual behaviour: "Google Analytics" is in the "Modules that will not be upgraded" section.
- Click "Perform upgrade" and wait for the upgrade to finish.
- Check the Google Analytics settings at
/admin/config/services/google-analytics- note the custom settings were migrated from D7 so the migration is working.
Proposed resolution
Declare the finished upgrade path from D6 and D7 by creating a migrations/state/google_analytics.migrate_drupal.yml and populating it appropriately.
Remaining tasks
Write a patch- Review and feedback
- RTBC and feedback
- Commit
- Release
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3330001-3--declare-google_analytics-upgrade-status.patch | 3.07 KB | mparker17 |
Issue fork google_analytics-3330001
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mparker17I've made my changes in merge request !20; but here's a patch for folks who prefer that method.
Setting to Needs Review to see if Testbot has any suggested improvements.
Reviews are welcome!
Comment #5
mparker17Interesting; I was expecting the tests to automatically enable the path_alias dependency; but apparently it did not. I've pushed a commit with updated tests to the merge request; let's see if it works.
Comment #6
mparker17While this patch only declares that the upgrade status is finished, and doesn't affect what actually gets migrated, I am happy to report that I was able to upgrade my Google Analytics configuration from my
drupal-7.99site runninggoogle_analytics-7.x-2.8to adrupal-10.2.1site runninggoogle_analytics-4.0.2using the migration code already in the D10 version of the module.I cannot RTBC this issue because I wrote the patch. But, hopefully, my success will help other people migrating D7 to D10.
However, now that my D7 to D10 site migration is complete, my ability to contribute further to this issue is severely limited, because the D7 site that I had been using to test has been retired. But, I'll keep an eye on this issue and try to answer questions to the best of my ability.
Comment #8
japerryLooks like some pieces are missing from the migration