Script to merge two Piwik databases or import sites from another Piwik. Upgraded and tested to work with Piwik 2.5.0.
$db_old = array(
'server' => 'localhost',
'user' => '',
'pass' => '',
'db' => '',
'prefix' => 'piwik_',
);
$db_new = array(
'server' => 'localhost',
'user' => '',
'pass' => '',
'db' => '',
'prefix' => 'piwik_',
);
$import_sites = array(2=>0);
php piwik_merge.php