3

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?

0

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());
$executable->import();

Your Answer

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

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