Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 2 KB

README.md

File metadata and controls

56 lines (44 loc) · 2 KB

data-migration

Salesforce Data Migration utilities.

Installation

Deploy to Salesforce

Unmanaged package

Overview

Services provide an ability to upload data from CSV files to SF. Custom binders alllow to format inport data and create the relationships.

  • Prepare CSV file (make sure that file doesn't have non ASCII symbols)
  • Split CSV file using FileSplit (each file must have less then 10k rows to avoid from SF DML limits, suggested count of rows is 5k)
run java Command-Line FileSplit.class app. Set total count or rows per file and file name
// Clean LOG.
MigrationTask deleteLogsMigrationTask = new MigrationTask(
    'deleteLogsMigrationTask',
    'SELECT Id FROM MIGRATION_Log__c',
    MigrationCleanUpService.class
);

// Clean imported Contacts. In case when you need to reimport the Contacts.
MigrationTask deleteContactsMigrationTask = new MigrationTask(
    'deleteContactsMigrationTask',
    'SELECT Id FROM Contact WHERE Migration_Status__c = \'Imported\'',
    MigrationCleanUpService.class
);

// Upload contacts from the Documents.
MigrationTask contactsMigrationTask = new MigrationTask(
    'contactsMigrationTask',
    MigrationUtility.getSoqlQueryForDocumentName('%contacts%'), // select * from Document where Name LIKE %contacts%
    MigrationContactsService.class
);


deleteLogsMigrationTask
    .setBatchSize(2000)
    .setNextMigrationTask(deleteContactsMigrationTask, 1000)    
    .setNextMigrationTask(contactsMigrationTask, 1);

deleteLogsMigrationTask.run();
  • Open MigrationLog page to see the log.