Importing Data into ProteanCMS - Eonic/ProteanCMS GitHub Wiki

Importing data into ProteanCMS can be done using a range of tools build into the core platform.

Import from MySQL

First you need to add the Protean.Providers.Database.MySQL to your project.

Ensure the MySQL.Data object is also added to the website project using NuGet.

Update the config files to contain the section group and the database providers sections below.....

<configSections>
    <sectionGroup name="protean">
      <section name="databaseProviders" type="Protean.ProviderSectionHandler, ProteanCMS" restartOnExternalChanges="false" />
    </sectionGroup>
  </configSections>
  <protean>
    <web configSource="protean.web.config" />
    <cart configSource="protean.cart.config" />
    <payment configSource="protean.payment.config" />
    <mailinglist configSource="protean.mailinglist.config" />
    <theme configSource="protean.theme.config" />
    <databaseProviders>
      <providers>
        <add name="MySQL" type="Protean.Providers.Database.MySQL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
      </providers>
    </databaseProviders>
  </protean>

Then you create an xml file to point to the data you would like to import.

We recommend you create a SQL view containing the data you wish to import.

<?xml version="1.0" encoding="utf-8"?>
<DatabaseImport databaseType="MySQL"
                databaseServer="dbserver"
                databasePort="3306"
                databaseName="dbname"
                databaseUsername="dbuser"
                databasePassword="dbpw"
                tableName="your-table-or-view"/>

then create an xsl/import folder in the project

in this add a new file called importManifest.xml looking like this

<?xml version="1.0" encoding="utf-8"?>
<Imports>
  <ImportGroup name="Imports">
    <Import name="YourImportType" xslFile="YourImportType.xsl" importDoc="xml">YourImportType</Import>
  </ImportGroup>
</Imports>

And create an import XSLT to convert your incoming data to whatever content you want from Protean.

See Import XSLT

⚠️ **GitHub.com Fallback** ⚠️