Shared blocks and files are only included if they are referenced. API wise it is though possible to export/import those resources standalone as well even if the UI is not possible.
What you can do is to add an eventhandler to the exporter and in the eventHandler add the blocks. Something like:
public class SharedBlocksExporter : IInitializableModule
public void Initialize(Framework.Initialization.InitializationEngine context)
DataExporter.Exporting += delegate(object sender, EventArgs args)
DataExporter dataExporter = sender as DataExporter;
dataExporter.SourceRoots.Add(new ExportSource(ContentReference.GlobalBlockFolder, ExportSource.RecursiveLevelInfinity));
Thank you for answer, it works perfectly.
Johan: Why haven't you just added the tree in the same manor as on "/cms/Admin/security.aspx" so that we can pick a reference from the block/media folder as well?
I agree that it would be useful to have a general content picker. I am not sure how the backlog looks for the UI team, but post this as a suggestion in the feature request forum and then it might get higher priority.
Feature request is here: http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=85483&epslanguage=en
Dear EpiServer Team,
1) I have a shared block (I implemented special type for this block (NewsBlock) and then created it in CMS):
- the shared block "My News" is in folder Global Library -> MyBlocks;
- the shared block wasn't used anywhere;
Why it wasn't imported?
I selected next items to export data:
1) Export content items;
Select part of structure -> Start Page
Export files that the pages link to
Automatically export dependent content types
2) Export content types: all 'Export content types' (SysRoot, SysRecycleBin, SysContentFolder were included)
3) Export categories
I created new empty database ans used it for my mvc site. I selected next options to import data:
1) the file to import;
2) the Root page as destination
3) checked 'Update existing content items with matching ID'
After import I found shared blocks in Global library, which were placed on page context area. But shared block "My News" and folder Global Library -> MyBlocks were not found.
Does Import support only pages, related content, page types and block types?
How to import unused shared blocks and folders from Global library?