from existing database to sitecore Items.
of my client wanted to migrate their old web site(that was in SQl server
database) to Sitecore 7.0.
migrate around 20k events items, 30k news,40k publications etc along with media
items like PDFS,Audio,Videos,Images etc into sitecore.
efforts/time, getting help from sitecore, re-coding the utility, we found some
take away points, from this data migration utility.
experience that may be useful to you and save your time,below are the key points
that should be take care at the time of creation the data migration utility.
- Disable all indexes during the migration
- Wrap the your custom logic into: SecurityDisabler(),
- Create store procedure in Sql server instead of direct
- 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
- Use optimize way to create media items like
- Skip the item that create error and log properly instead of
- 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.
procedure in c#:
connection string “;
da.SelectCommand.Parameters.Add(new SqlParameter(“@parameter name”, parentFolder));
(DataRow row in dt.Rows)
sitecore Item C#
I hope this post would useful to you regrading data migration into sitecore.
Happy Coding !!