Sitecore - How to import content?

2019-06-25 14:03发布

So i got a new task to import content from a website to a new website built using Sitecore CMS. My client is doing a revamp basically. The previous website was built using a very old CMS and everything is in HTML format. I'm actually thinking to crawl the old website and dump all the contents in csv format or so...but I need to know..

  1. if Sitecore provides a feature within the CMS or web service to import external data?
  2. If yes, in what format (csv, xml)?
  3. If not, may I know if there is any alternative or plugins?

There are so many documentations and I'm really confused where to start. I hope I don't have to write scripts to do just this.

If any of you guys have done this, itwill be great if you can share your experience.

Thanks.

标签: sitecore
2条回答
我命由我不由天
2楼-- · 2019-06-25 14:30

6 years late to the party, but should anyone other than me stumple over this question, i would strongly recommend Sitecore Powershell extensions : https://marketplace.sitecore.net/en/Modules/Sitecore_PowerShell_console.aspx

查看更多
SAY GOODBYE
3楼-- · 2019-06-25 14:38

OK, so this is a good news / bad news situation.

Sitecore does not have a standard 'import' facility and you will very likely have to write a C# script to import your content. Sitecore allows you to define any number of data structures (templates) to shape the content types you will need for your site so a tool for importing from a CSV/XML etc is going to have a hard job as there are so many different possibilities for how the new site might be structured and the features that may be used.

The good news is that Sitecore has a very powerful C# API that makes working with data very simple and I would recommend looking at the cookbooks such as the Content API Cookbook on SDN. This has information on working with templates, items and the different field types that are available.

The script you would need to write wouldnt need to be massively complicated but running a migration in a fashion such as this allows you extra room to do things like:

  • Stripping HTML tags from the content. (I would suggest using HtmlAgility)
  • Tracking / remapping links to old pages in the link tags.
  • Removing references to images or remapping to new paths or references to the media library.
  • Taking full advantage of Sitecore's different field types

I'm assuming you have not completed any Sitecore training yet and I would make this a priority so you can understand about how data and content is structured in Sitecore.

There is no silver bullet in this scenario but in my experience writing these small scripts is not time consuming and allows you to handle the often complex requirements that a content migration brings with it.

Hope this helps.

查看更多
登录 后发表回答