Skip to content

dlisovsky/data-migration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Salesforce Data Migration utilities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages