$saleModulePermissions = $APPLICATION->GetGroupRight("sale");
if ($saleModulePermissions < "W")
	$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));

Main\Loader::includeModule('sale');

include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/sale/lib/location/migration/migration.php");

Loc::loadMessages(__FILE__);

$result = 	true;
$errors = 	array();

try
{
	$migration = new Migration\MigrationProcess();
	$migration->hideNotifier();

	// action: process ajax
	if(isset($_REQUEST['AJAX_MODE']))
	{
		$data = array();

		if($_REQUEST['step'] == 0)
			$migration->reset();

		try
		{
			$data['PERCENT'] = $migration->performStage();
			$data['NEXT_STAGE'] = $migration->getStageCode();
		}