Skip to content

Data lost on surveys tables with legacy installations #6275

@andreslucena

Description

@andreslucena

Describe the bug
As an implementer, if I upgrade an old Decidim installation and I didn't execute the command for migrating from legacy decidim-surveys tables to decidim-forms tables, then I lost all my surveys data (!!!).

To Reproduce
Steps to reproduce the behavior:

  1. Starting with a legacy installation with data on decidim-surveys tables
  2. Execute the upgrade (decidim:upgrade / db:migrate)
  3. Go to see the decidim-surveys responses
  4. See that I lost my data

Expected behavior
To not have my data removed.
We should be extra careful when remove data and working with legacy tables.
One possible solution would be:

  1. Add a migration task that first check if there's content on decidim-surveys legacy tables. This should be executed before removing (of course)
  2. On that migration, it should be the code from decidim_surveys:migrate_data_to_decidim_forms task
  3. We should also remove the decidim_surveys:migrate_data_to_decidim_forms task as it doesn't make sense now

As an alternative, when executing the migration for deleting the data we should stop and make a warning if there's data on those tables.

Screenshots
If applicable, add screenshots to help explain your problem.

Stacktrace
If applicable, add the error stacktrace to help explain your problem.

Extra data (please complete the following information):

  • Decidim Version: 0.23.dev and I'm not so sure if this also is on 0.22 (I didn't check it yet)
  • Decidim installation: FundAction

Additional context
This comes from #6178
See comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions