Running the HierarchyMigration Job in the Developer Console
The HierarchyMigration job reestablishes the parent-child relationships between the beans based on the Salesforce account hierarchy. If you want to fix any hierarchy-related issues in the beans, you can manually run a HierarchyMigration job in the Salesforce Developer Console.
If you have hierarchy enabled for accounts, during synchronization of the records, the migrate jobs create record entries in a Staging Cache table. The HierarchyMigration job processes only the record entries available in the Staging Cache table.
The following sample code runs the HierarchyMigration batch job in the Salesforce Developer Console:
API_QueueManager qManager = new API_QueueManager ('HierarchyMigration', 'DS_HierarchyMigrateBatchClass');
Id batchJobQueueId = qManager.submitJob();