v3 to v4 script fails when the U&P plugin is not installed
Bug report
Required System information
- Node.js version: 16.13.0
- NPM version: 8.13.2
- Source Strapi version: 3.6.8
- Target Strapi version: 4.1.9
- Source Database: PostgreSQL 12.9
- Target Database: PostgreSQL 12.9
- Operating system: WSL2 / Ubuntu 20.04
- Which script are you running:
v3-sql-v4-sql
Describe the bug
If the U&P plugin is missing from the target project, the script will crash.
error: delete from "up_permissions_role_links" - relation "up_permissions_role_links" does not exist
Steps to reproduce the behavior
Pretty straightforward, just try a migration, targeting a project without U&P installed.
Expected behavior
I would expect a warning message explaining that the U&P plugin is probably not installed, and the users' permissions were not migrated. Apart from that everything should work nonetheless.
Or you can choose to stop there and tell the user to add U&P to his/her app but then it implies that U&P is not really a plugin as it's required.
We would likely need to add a special exception here or possibly just build an optional addtional custom migration that would just ignore/delete these during the migration.
@martincapek What are your thoughts here?
for context, in v3 the users-permissions plugin was required, in v4 it's optional and is currently installed by default but in the near future it won't be. I think the main issue here is that the scripts are not "code aware" to see if the plugin is installed on the v4 project since it only looks at the database? Should we just have some .env config options to disable syncing certain build in features like users-permissions, etc?
We can add env variable to disable migration of DISABLE_UP_MIGRATION
Hi, should be fixed in https://github.com/strapi/migration-scripts/pull/74