- Disable all indexes during the migration
- Wrap the your custom logic into: SecurityDisabler(), EventDisabler(), ProxyDisabler()
- Create store procedure in Sql server instead of direct query.
- Create web API( controllers) to run the utility instead of separate page or any other technology(get rid of the time out problem)
- Divide the data into parameter functions, instead to run utility as whole divide it into chunks that would call through controller.
- Logging the utility, log record and exception so that it would be traced if needed.
- Write the utility in such a way that would easily updated instead of deleting all item and re-run(it’s really very time consuming).
- Use proper check like DBNULL and not null condition in code.
- Assign item id for reference field include media items.
- Use ProposeValidItemName function while creating item,More Detail
- Proper handling for date field. I am enclosing the code below.
- Use optimize way to create media items like image,pdf,videos,More detail
- Skip the item that create error and log properly instead of application crash.
- Effectively handle folder creation, don’t create more than 100 items under one folder, create the folder on basis of some logic like Year,Month,date or Bucketable folder etc.
I hope this post would useful to you regrading data migration into sitecore.
Happy Coding !!