\Bitrix\Main\Loader::IncludeModule('im');
/**
* @var integer Чьи настройки берем (id)
*/
$fromUserId = 1;
/**
* @var integer Кому их сохраняем (id)
*/
$toUserId = 2;
$userSettings = CIMSettings::Get($fromUserId);
foreach ($userSettings as $type => $value)
{
CIMSettings::Set($type, $value, $toUserId);
}