1

I have a bunch of migrations that update a bunch of nodes. I want to automate the process and also be able to rollback / add / update specific nodes for specific migrations.

Basically I need a button next to an item in a list and clicking the button to execute something like:

drush mr migration_name --idlist="my item id"

or

drush mim migration_name --idlist="my item id"

I tried making a php file that I can call via rest and have it exec('drush whatever I want') but I'm having issues with that:

array(7) { [0]=> string(0) "" [1]=> string(153) "Fatal error: Uncaught RuntimeException: Your environment or operation system isn't supported in /chroot/drush/vendor/webmozart/path-util/src/Path.php:257" [2]=> string(12) "Stack trace:" [3]=> string(75) "#0 /chroot/drush/drush.php(58): Webmozart\PathUtil\Path::getHomeDirectory()" [4]=> string(56) "#1 /chroot/drush/drush(4): require('/chroot/drush/d...')" [5]=> string(9) "#2 {main}" [6]=> string(77) " thrown in /chroot/drush/vendor/webmozart/path-util/src/Path.php on line 257" }

So I'm looking for some alternative or creative solution. Thank you in advance

  • 3
    Does this answer your question? How to execute a migration? – Hudri Jan 20 at 17:39
  • Why not just call drush remotely? Other than that you can execute migrations any which way from code in a form callback or what have you. – Kevin Jan 20 at 18:47
  • How can I do that (i tried via php but the exec is not working for me - see post) – Yagod Jan 21 at 22:33
  • How can I execute that from a view button? – Yagod Jan 21 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.