Content management system 将不同CMS中的内容导入episerver数据库

Content management system 将不同CMS中的内容导入episerver数据库,content-management-system,episerver,Content Management System,Episerver,我正在将一个遗留CMS迁移到EPiServer CMS。我想将内容从遗留CMS移动到EPiServer的数据库中。有人遇到过这样的情况吗?我在world.episerver.com上查看了他们的文档,但不太清楚。它说要在管理部分的配置选项卡下配置EPiServer站点,以定义内容通道。但他们并没有具体讨论要使用什么API,以及数据库中的不同字段如何映射到EpiServer的数据库。任何帮助都将不胜感激。您不应该直接复制到数据库中,因为要获得正确的结果非常困难。 您需要从在项目中构建内容类型开始,

我正在将一个遗留CMS迁移到EPiServer CMS。我想将内容从遗留CMS移动到EPiServer的数据库中。有人遇到过这样的情况吗?我在world.episerver.com上查看了他们的文档,但不太清楚。它说要在管理部分的配置选项卡下配置EPiServer站点,以定义内容通道。但他们并没有具体讨论要使用什么API,以及数据库中的不同字段如何映射到EpiServer的数据库。任何帮助都将不胜感激。

您不应该直接复制到数据库中,因为要获得正确的结果非常困难。 您需要从在项目中构建内容类型开始,然后我认为导入内容的最简单方法是构建计划任务或使用导入页面扩展管理界面。 因为您是唯一知道旧CMS中的内容应该在EPiServer中的人,所以您可以自己进行映射

如果您是EPiServer的新手,那么这不是一件容易的事情,我认为这可能是联系专家服务的最快方式,他们将帮助您进行最终指导


祝你好运

您可以使用EpiServer的IContentRepository和IContentTypeRepository以编程方式添加页面,如下所示:

using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.DataAnnotations;
using EPiServer.ServiceLocation;

PageReference parent = PageReference.RootPage;

IContentRepository contentRepository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentRepository>();
IContentTypeRepository contentTypeRepository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentTypeRepository>();

PageData myPage = contentRepository.GetDefault<PageData>(parent, contentTypeRepository.Load("StandardPage").ID);

StandardPage standardPage = contentRepository.GetDefault<StandardPage>(parent);

myPage.Property["PageName"].Value = "Name";
myPage.Property["MainBody"].Value = "My Page";
myPage.Property["PageTypeName"].Value = "Standard Page";
myPage.Property["PagePendingPublish"].Value = true;

myPage.URLSegment = EPiServer.Web.UrlSegment.CreateUrlSegment(myPage);                    

contentRepository.Save(myPage, EPiServer.DataAccess.SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess);
使用epserver.Core;
使用epserver.DataAbstraction;
使用epserver.DataAnnotations;
使用epserver.ServiceLocation;
PageReference父项=PageReference.RootPage;
IContentRepository contentRepository=epserver.ServiceLocation.ServiceLocator.Current.GetInstance();
IContentTypeRepository contentTypeRepository=epserver.ServiceLocation.ServiceLocator.Current.GetInstance();
PageData myPage=contentRepository.GetDefault(父级,contentTypeRepository.Load(“StandardPage”).ID);
StandardPage StandardPage=contentRepository.GetDefault(父级);
myPage.Property[“PageName”]。Value=“Name”;
myPage.Property[“MainBody”].Value=“我的页面”;
myPage.Property[“PageTypeName”].Value=“标准页面”;
myPage.Property[“PagePendingPublish”]。Value=true;
myPage.URLSegment=epserver.Web.URLSegment.CreateUrlSegment(myPage);
contentRepository.Save(myPage,epserver.DataAccess.SaveAction.Publish,epserver.Security.AccessLevel.NoAccess);