Statistics - How to migrate to the new module without losing data?
Drupal 10.3.10

Comments

alex.kirk created an issue. See original summary.

cilefen’s picture

Project: Drupal core » Statistics
Version: 10.3.x-dev » 1.0.0
Component: statistics.module » Code
Assigned: alex.kirk » Unassigned

I am not sure anything is required except to add the contributed module into the codebase when upgrading to Drupal 11.

Nevertheless I am moving this issue to the contributed project because that is a better place for questions.

freelylw’s picture

same question here, I have 100k+ views count for each of my users, I can't lose those views count, should I just enable this new module and disable the previous core Statistics module, then the previous node count will be kept ? Thanks

xmacinfo’s picture

  1. Always do a backup of the database first
  2. Run composer require drupal/statistics
  3. Enable counting at /admin/config/system/statistics

Do not uninstall at anytime. Doing so will delete all stats,

Since the module is using the same namespace, the contrib module should be automatically enabled after running the composer require command.

I did not loose any statistics with this module. But I played it safe by performing a backup before switching to the contrib Statistics module.

Also note this (taken from this module page):

No default view is provided in the initial release, to match Drupal the legacy Drupal core behavior. Enable counting at /admin/config/system/statistics.

berdir’s picture

Status: Active » Fixed

Yes, this is not a new module. It's the same module, it just lives in a different place now.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

fgm’s picture

Contrib record updated. Thanks all.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ressa’s picture

See also this related issue, since clearing caches can be a challenge.