How to bake migrations migration_snapshot to the plugin using another connection (Cake 4)

My setup:

DB: blog (250MB data), forum (phpbb, 3GB)

app.php Datasoures default => blog, forum => forum;

Todo:
migrate old php5 app to php 7.x


I have bake plugin forum, now inside this plugin i want to bake new forum app, but first of all, i have task to migrate and reduce old and robust phpbb db ((we think that some db tables are unnecessary for the future app, etc).

I try to bake migrations_snapshot in this plugin using --connection forum, but this create only php file with empty up and down methods.

bin/cake bake migration_snapshot ForumInit --plugin Forum --connection forum

If I try to bake direct in app migrations folder like:

bin/cake bake migration_snapshot ForumInit --connection forum

This create migration file with all db tables in up and down methods.

So, how to bake migration to plugin with custom connection?

I think you should open an issue on the bake repo

For now you can bake the snapshot and move to the plugin folder, you’ll have to mark as not migrated or delete the migration row on the phinxlog table

1 Like

Thanks for suggestion