strapi-webtools icon indicating copy to clipboard operation
strapi-webtools copied to clipboard

Migrating content with strapi built-in function breaks the aliases

Open Norbz opened this issue 2 years ago • 5 comments

Bug report

Describe the bug

When using strapi import / export function to reinstall a strapi instance on another server, the pattern and list is correctly migrated, but every path is actually duplicated to another -0one. the /about path is visible on the list, but on the database, we have /about-0

Steps to reproduce the behavior

  1. export a strapi backup with strapi export --file backup
  2. Import in another database / another server with strapi import backup.tar.gz

Expected behavior

Path association should remain intact

System

  • Node.js version: v18.17.0
  • NPM version: v9
  • Strapi version: Tested on v4.12.7
  • Plugin version: beta.10
  • Database: mysql
  • Operating system: Linux / MacOS

Additional context

Might be related to #51 and/or to #43

Norbz avatar Sep 13 '23 14:09 Norbz

Interesting, this might be because lifecycles run during import, causing the paths to be generated an extra time.

I had a similar issue when using the transfer function and another plugin with lifecycles, those lifecycles ran during the transfer.

I think we could resolve this by checking if the path already exists during the lifecycle, although it might not be that easy.

Imo this is a bug with Strapi, I think they should either make it such that some lifecycles can be disabled during import/export or just don't run the lifecycles at all at those times.

Alexnortung avatar Sep 13 '23 16:09 Alexnortung

Maybe a proper relationship would correct this behavior ?

Norbz avatar Sep 13 '23 17:09 Norbz

@Norbz Could you test this again with the latest version?

We now have proper relations and I suspect this issue to have been resolved.

boazpoolman avatar Jan 31 '24 20:01 boazpoolman

Hi there.

Sorry for the delay. Lost job 4 months ago, now being freelancer. I don't have access anymore to the project where I had the issue, ill try to reproduce with web tool :)

Norbz avatar May 02 '24 14:05 Norbz

That would be amazing :D

boazpoolman avatar May 06 '24 10:05 boazpoolman

I'm closing this due to inactivity.

@Norbz If you ever run into this issue again feel free to report a new issue!

boazpoolman avatar Jun 01 '24 11:06 boazpoolman