-2

I need to

  • Create new nodes (W/12 fields) hourly from a new table/fields in the Drupal DB (x_table).
  • Update currently created nodes via current x_table rows.

  • Delete nodes once the row has been removed from x_table.

My skill sets do not include coding, and for years I have gotten by with the great Drupal modules, although I haven't had to import/update/delete rotating 10,000+ nodes. I previously used Feeds w/out updating, and it was extremely slow.

I've been reading I should be using the Migrate module and/or Drush. (I understand that Drush is part of Migrate)?? Anyhow I have installed the migrate module, but I have been completely baffled for an hour by their UI. It seems I need to create some data/text files for it to work, which is why I was trying to use the UI.

I feel that it will likely be best to create these scripts using Drush and calling them hourly via cron.

My question is, how do I create the script?? I'm not quite sure how to map the fields either? Could someone suggest a page showing this, or put together a quick example to work off of? 30 mn's of using the search engine hasn't shown me much, mostly only using csv files, etc. and not pulling from a database.

Thanks in advance for any help/suggestions.

-1

In your module for the migration use this code:

function YOURMODULENAME_cron() {
$machine_name = "MACHINE NAME OF YOUR MIGRATION";
$last_run = variable_get('YOURMODULENAME_last_cron', 0);
$interval = variable_get('YOURMODULENAME_cron_interval', 60);//60 seconds
if(time() - $last_run > $interval)
  {
   variable_set('YOURMODULENAME_last_cron', time());//track the last_run time
   $migration = Migration::getInstance($machine_name);
   $result = $migration->processImport();
  }
}

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.