Salesforce Data Migration utilities.
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
- Upload CSV parts as SF documents with FileUpload page
- Create migration service using data binders Example MigrationContactService
- Run migration process
// 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.