Tag Archives: export files

EPiServer CMS 6: Exporting lots and lots of files

Exporting lots of files from EPiServer CMS 6 can be a pain. Picking the files, one at a time, can take ages and when your done and press “Export”-button, session has probably times out and you have to do it all over again.

On top of that, if you upload-folder are huge (this one is 21Gb), for some reason the file browser dialog won’t open at all. (I’m not absolutely sure the size is the issue, but i think it is). So what to do?

You could create i job that reads all links from tblPageSoftLink, resolve their names, save the file and so on. That’s a nice solution off course, but i wanted i quick solution. So what to do?

I decided to take trick EPiServer, using FireBug, to work around the file browser dialog. this is what i did:

First, i created a list of the files i needed to export. Using your favorite editor it should be easy to generate a list of options with the file names and paths

<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/annotations.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/ast_alert.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/ast_loader.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/ast_navicons.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/ast_notes.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/ast_remote.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/ast_vidpresenter.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/attach.html">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/blank.html">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/button.gif">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/flashcommand.js">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/mod_colorizer.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/mod_engage.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/mod_exit.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/mod_quiz.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/null.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/PassVar.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/playershell.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/slidegroup.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/stealthray.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/utils.js">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/VideoPlayer.html">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/VideoPlayer.swf">
<option value="/Upload/Forebyggande/Informationssakerhet/Utbildning_kryptering/player/zoom.html">

I then went to the admin-mode, “Export data”, checked the “Export files”-option. Now, instead of pressing “Add files”, start FireBug and use the inspect element-tool and select the listbox:

inspectelement

Right-click the selected HTML-code, and choose edit html:

edithtml

Paste your list between <select> and </select>, when done press the “edit”-button in the top left to close the edit.

pastelist

Using the inspect element-tool again, you can see there’s a lot of files in the listbox. You could off course add the file names again, after the option tag to make them visible in the list.

inspectfiles

Press export and save the file. Locate the file on the disk, rename ExportedFile.episerverdata to ExportedFile.zip and open it. Inside the ZIP, there’s a folder with the same name as your upload, in my case it’s called SiteUpload.

exportedfile

In that folder there’s a folder structure similar to the one on the site. Just navigate through the folders and there’s your files!

files