May you can schedule the update task on cron run when site expects the least tracffic.In order to schedule the udpate process at specific time you can use elysia cron module. This way you will be able to update in bulk keeping revisions update as well and also the script will run as standalone.
Step 1 : Schedule the updat task(assuming you are using elysia module).
function mymodule_cron_cronapi($op, $job = NULL) {
$items['update_node_user_author'] = array(
'description' => 'Update node user author',
'rule' => '0 12 * * *',
'callback' => 'mymodule_update_node_author',
);
return $items;
}
//cron call back
function mymodule_update_node_author() {
// add logic to get $uid and $uid2
// $uid is the user id you want to change for.
// $uid2 is the user id you want to change with.
exec("/usr/bin/php update_author.php $uid $uid2> /dev/null 2>&1 &");
}
Now create a php script named as update_author.php in your drupal root add the following code inside it.
<?php
if (!isset($_SERVER['REMOTE_ADDR'])) {
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
}
$uid = $argv[1];
$uid2 = $argv[2];
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node');
$query->propertyCondition('uid',$uid);
$result = $query->execute();
if (isset($result['node'])) {
$nids = array_keys($result['node']);
$nodes = node_load('node', $nids);
}
foreach($nodes as $node) {
$node = node_load($nid);
$node->uid = $uid2;
node_save($node);
}