Export

From Sense/Net Wiki
Jump to: navigation, search
  •  
  •  
  •  
  •  
  • 100%
  • 6.0
  • Enterprise
  • Community
  • Planned

Overview

Export

The content in the Sense/Net ECMS Content Repository are stored in the database, but content items can be exported for future import using the built-in Export tool. This feature can be used for either backup purposes or to transfer the contents of the repository to another installation enabling administrators to easily create a copy of a previously existing system and Import content later.

Details

Content in the file system

Content items in the file system are represented by xml files of .Content extension and any binary attachment is placed there as a regular file. An image for example can be represented by two files: a .Content file that describes the Content to be created (defines the Content Type, Display Name, all Field values, permissions) and an image file (i.e. image01.png) that holds the binary image information. The exported folder structure will correspond to the Content Repository tree structure to be created in the database and therefore can be imported easily.

Usage

The tool is either located in the web folder or in case you are using the source version you will find it under the following folder:

Source\SenseNet\Tools\Export\bin\Debug

When executing without parameters the usage screen is displayed with all possible parameters.

  • SOURCE (optional): Sense/Net Content Repository path (folder, site, workspace, etc.) as the import target. Default: /Root.
  • TARGET: The file system path of the directory that will contain exported content.
  • ASM: (optional) by default this is the folder of the export tool. It is advisable to give the web folder bin directory path here if the export tool is not placed in the web folder, because Content Handler libraries (system and third party as well) are required for the export - and they are always placed in the web folder.
  • FILTER (optional): you can place a content query to a text file and provide the path of the file here. The exporter will execute the query and export only the result content to the target folder preserving the repository folder structure.
  • WAIT (optional): if given the exporter tool will wait for an enter key to let developers attach to the process with a debugger.

See #Example/Tutorials section for examples.

Configuration

You will not need to configure MSMQ for running the export tool but you will need to enable indexing (Lucene) as the tool uses the search engine to discover the content to export.

Changes made on content while export is in progress may have unwanted side effects; e.g. deleting content during export will cause a critical error.

The configuration of the tool can be changed in the Export.exe.config file. The most important parts are the following:

  • MSMQ is switched OFF (ClusterChannelProvider and MsmqChannelQueueName keys)
  • Indexing is switched ON (EnableOuterSearchEngine and IndexDirectoryPath keys)

Logging

The export tool creates a log file placed next to the executable, with the name exportlog.txt. This file contains the verbose output of the export tool with timestamps, and thus contains any errors or exceptions that occurred during export.

The exportlog.txt is not a rolling file, and thus every export overwrites the log file of any previous export process.

Example/Tutorials

All examples are executed from the Deployment folder.

Exporting the full repository

..\Source\SenseNet\Tools\Export\bin\Debug\Export.exe 
   -TARGET D:\Root 
   -ASM ..\Source\SenseNet\WebSite\bin

Exporting Content Templates subtree

..\Source\SenseNet\Tools\Export\bin\Debug\Export.exe 
   -SOURCE /Root/ContentTemplates 
   -TARGET D:\ContentTemplates 
   -ASM ..\Source\SenseNet\WebSite\bin

Exporting all users

..\Source\SenseNet\Tools\Export\bin\Debug\Export.exe 
   -SOURCE /Root/IMS 
   -TARGET D:\Users 
   -ASM ..\Source\SenseNet\WebSite\bin

Related links

References

There are no external references for this article.