Skip to main content

Content Export and Import

Come here if you're trying to do content-editor things like:

  1. Import data from Excel or into 2sxc - like addresses, lists of products and similar
  2. Do mass-operations like mass-editing or delete many content-items
  3. Export data for mass-translation, to then re-import another language
  4. Migrate data to/from another DNN tool like Form and List, XMod, r2i OWS, DNNMushroom, Packflash or similar with 2sxc
  5. Import content to/from another .net CMS like UmbracoSitefinity, Kentico, SharePoint or sitecore with DotNetNuke
  6. Import content to/from another CMS like Wordpress, Joomla, Drupal, typo3 with DNN

This page is targeted at content-editors. For advanced import/export and data-integration topics as well as accessing SQL-data (which are usually developer topics) we'll create a separate help section. 

Basics of Content Export and Import

Before we start, let's get a few basics understood

  1. Content is very flexible - so some content-items could have 3 fields (Title, Body, Image) while others have many fields (like an address having 20 fields)
  2. Content is sometimes multi-lingual - so some fields may be translated into many other languages
  3. When content is multi-lingual, 2sxc needs to know which fields are translated, and which should automatically show the default language...
  4. ...and 2sxc must know, which is the default language

To accomodate for all these possible scenarios, 2sxc expects the import-data to be in a structure that it understands. This is a simple XML-format, which can be edited in Excel. This is all rather simple - but requires you to know 1-2 tricks for working with the data.  

Export-Dialog

In general it's self-explaining, here some details you may not figure out yourself:

  1. If all you need is a template to fill in your data - go ahead and choose Export data: No, just export blank... 
  2. The Value-References are internal references how languages work. This is important to ensure that a re-import will create the identical state as the system currently has. So if the DE title is not translated it will export as [] (meaning empty) or if it references the Ukraine title it would be something like [ref(uk-UA,rw)]. If you choose to replace references, then the export would contain real text - which would also be imported again later on. 
  3. File/page reference behaves the same way. If you plan on re-importing the content (after editing it), then you should use the references.

Working with Data in Excel

Excel can help you work with XML-Data, but you must know 2 important tricks. This is the general process:

  1. Export data (or empty template-xml) from 2sxc
  2. Open in Excel
  3. Work with the data as needed, save as Excel while you're working
  4. Export back into XML for re-import later on

If you do this you should see your data in a colored table as shown in the image, always starting with a GUID column and a Language column. These are explained more below. 

Opening the XML in Excel

You can just open the XML directly in Excel with

  1. Use the normal File > Open 
  2. Pick your file
  3. In the dialog appears just click Ok

Common Export / Import for Content-Editors

In the following sections we'll guide you through common import/export actions which a content-editor might want to do. 

Mass-Editing existing content

Do the following

  1. Export the data
  2. Mass-edit in Excel
  3. Save-As XML
  4. Re-Import

A few tips:

  • The GUID column is important to ensure that the correct data gets imported. Make sure it still has the original GUID after updating the data. 
  • In case you're using formulas to mass-edit your data, make sure you copy them out and paste-as-values before re-importing
  • If you want to add more content-items you can do this - just add more rows with an empty GUID

Special Codes / Placeholders in the Export-File

You may see the following things in an export - so here's what they mean:

  1. File:37 - this means that we're pointing to a file in DNN, and this is the internal DNN-number. If you would rather have the full file-name, there's a switch in the export dialog to deliver the full path. 
  2. Page:105 - same thing - a page in DNN
  3. [""] - this is a special placeholder saying that there is a value, but it's an empty piece of text. This is important for the re-import, because otherwise the XML would remove the value (which is not the same thing as an empty value) and cause side-effects. So importing a ="" will replace the existing field with an empty text. 
  4. [] - this is a special placeholder saying that there is no value stored - or if you re-import this, that any stored value is removed. 
  5. Difference between [""] and []      
    1. In a multi-language environment, any field containing [] (meaning no value) will automatically deliver the same field in the original language. So no value means "This is not translated, please take the default value". But a field containing [""] (meaning value is empty text) will mean "this field is translated, and the translation is an empty text". 
    2. In a single-language environment they have almost the same effect - but it could be that your output-templates check for empty values. For example, you could have a template showing a "Author unknown" message if the Author-field is empty, then removing the field [] could have side effects. 
    3. In general: if you don't have a specific reason for replacing / removing one of these placeholders, it's best to leave them the way they are
  6. [ref(en-US,ro)] - this only exists on multi-language data and means that this value specifically references (uses) the value from the language specified in the brackets. The remaining code gives additional hints about read/write-share information - but in most cases you don't need to understand it as these are advanced use scenarios. 

Advanced Cases for Import/Export of Content

The following are special use cases which I would like to explain

  1. When importing data which already has a GUID as identity (for example if your products have a GUID or your addresses have a GUID in the CRM), then you can use this GUID in 2sxc as well. Just place the GUID in the GUID column. 
  2. When importing content to update parts of a list you can import a short list containing only changed content-items. By default, all other content-items will be untouched. 

Special Multi-Language scenarios

  1. When importing multiple languages at the same time you can give all matching content-items the same GUID or you can leave the GUID empty. 
  2. If you leave the GUID empty, the import will then detect which ones belong together based on the order they are in the list. So every row after the first is "the same item" until a row appears with the same language as the first row. The import will then expect that each content-item has the same amount of rows. 

Relationships to other data

If you have a field like Author which points to another Content-Item you can also export/import these references. 

  • If you need just one value, just put the GUID of the target into the field
  • If you need multiple values, put all the GUIDs there, comma separated

If you are importing complex data with multiple tables, it's easiest to

  1. first import the pointed-at-data (like the Authors)
  2. if you did not import GUIDs (which is usually the case) then re-export the authors - you now know what GUID they have...
  3. based on this list and some VLOOKUP-magic in Excel, add the Author-GUIDs to the data you want to import
  4. ...and finally import those tables

Note that you can import the lists in any sequence you like - since you can re-import them again after the pointed-at-data exists. So if an employee points to another employee (like the boss), then just do the initial import without the reference and re-import it again with the references.