We are trying to migrate a huge number of content. The destination is something like articles/ news/ blogs.

The source is JSON files grouped by month-year of creation.

The volume is like half a million of each type of records from 2005.
Eg. blog-apr-2005.json, blog-may-2005.json, blog-jun-2005.json… blog-may-2006.json,.. blog-may-2007.json,… etc

Currently we are changing the Migrate Source in the code each and everytime before migrating.

Migrate module has been of tremendous timely help here.

We had to have the migrate code pick up the file dynamically from the source folder and migrate.

Please suggest if we can directly read the files in a loop and migrate.

Your help / guidance here will be very valuable.

Thanks,
Ramkumar R

Comments

mikeryan’s picture

Status: Active » Fixed

Just use MigrateSourceJSON, and pass an array with all your files as the first parameter:

$files = array(
  'blog-apr-2005.json',
  'blog-may-2005.json',
...
);
$this->source = new MigrateSourceJSON($files, 'id', $fields);
ramkumarr’s picture

Thank you so much.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.