My goal is to import data of customers from a csv file to my custom entity. For that I wrote a migration with the migrate_source_csv module as source plugin. This works fine, but the problem is, that the import is just possible with drush. But it should work with an UI where a user can upload a file and run the import.

Is there any way to execute the import without drush?


2 Answers 2


The Wordpress Migrate module is a great example of how to implement a UI to upload a file and create a migration for it. Once you have that, it shouldn't be too difficult to run the actual migration via code.

Create Migration configuration from information and file provided to your Wizard Form. Then the following should work.

$migration = Migration::create($configuration);
$executable = new MigrateExecutable($migration, new MigrateMessage());

The Migrate Source UI module might also be useful for this purpose.

It offers: "User interface for importing data from JSON, CSV or XML sources. Work with migrate tools and other migrate modules to allow someone to upload the source file."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.