{"id":384,"date":"2015-10-02T09:14:05","date_gmt":"2015-10-02T08:14:05","guid":{"rendered":"http:\/\/jonika.nu\/JonasBlogg\/?p=384"},"modified":"2022-07-08T10:32:03","modified_gmt":"2022-07-08T09:32:03","slug":"exporting-lots-and-lots-of-files","status":"publish","type":"post","link":"https:\/\/jonika.nu\/JonasBlogg\/archives\/384","title":{"rendered":"EPiServer CMS 6: Exporting lots and lots of files"},"content":{"rendered":"<p>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 &#8220;Export&#8221;-button, session has probably times out and you have to do it all over again.<\/p>\n<p>On top of that, if you upload-folder are huge (this one is 21Gb), for some reason the file browser dialog won&#8217;t open at all. (I&#8217;m not absolutely sure the size is the issue, but i think it is). So what to do?<\/p>\n<p>You could create i job that reads all links from tblPageSoftLink, resolve their names, save the file and so on. That&#8217;s a nice solution off course, but i wanted i quick solution. So what to do?<\/p>\n<p>I decided to take trick EPiServer, using FireBug, to work around the file browser dialog. this is what i did:<\/p>\n<p>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<\/p>\n<pre class=\"lang:xhtml decode:true\" title=\"List of files\">&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/annotations.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/ast_alert.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/ast_loader.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/ast_navicons.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/ast_notes.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/ast_remote.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/ast_vidpresenter.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/attach.html\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/blank.html\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/button.gif\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/flashcommand.js\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/mod_colorizer.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/mod_engage.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/mod_exit.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/mod_quiz.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/null.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/PassVar.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/playershell.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/slidegroup.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/stealthray.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/utils.js\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/VideoPlayer.html\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/VideoPlayer.swf\"&gt;\n&lt;option value=\"\/Upload\/Forebyggande\/Informationssakerhet\/Utbildning_kryptering\/player\/zoom.html\"&gt;<\/pre>\n<p>I then went to the admin-mode, &#8220;Export data&#8221;, checked the &#8220;Export files&#8221;-option. Now, instead of pressing &#8220;Add files&#8221;, start FireBug and use&nbsp;the inspect element-tool and select the listbox:<\/p>\n<p><a href=\"http:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/inspectelement.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-386\" src=\"http:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/inspectelement.png\" alt=\"inspectelement\" width=\"1183\" height=\"795\" srcset=\"https:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/inspectelement.png 1183w, https:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/inspectelement-300x202.png 300w, https:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/inspectelement-1024x688.png 1024w\" sizes=\"(max-width: 1183px) 100vw, 1183px\" \/><\/a><\/p>\n<p>Right-click the selected HTML-code, and choose edit html:<\/p>\n<p><a href=\"http:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/edithtml.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-387\" src=\"http:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/edithtml.png\" alt=\"edithtml\" width=\"617\" height=\"346\" srcset=\"https:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/edithtml.png 617w, https:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/edithtml-300x168.png 300w\" sizes=\"(max-width: 617px) 100vw, 617px\" \/><\/a><\/p>\n<p>Paste your list between &lt;select&gt; and &lt;\/select&gt;, when done press the &#8220;edit&#8221;-button in the top left to close the edit.<\/p>\n<p><a href=\"http:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/pastelist.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-388\" src=\"http:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/pastelist.png\" alt=\"pastelist\" width=\"879\" height=\"492\" srcset=\"https:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/pastelist.png 879w, https:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/pastelist-300x168.png 300w\" sizes=\"(max-width: 879px) 100vw, 879px\" \/><\/a><\/p>\n<p>Using the inspect element-tool again, you can see there&#8217;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.<\/p>\n<p><a href=\"http:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/inspectfiles.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-390\" src=\"http:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/inspectfiles.png\" alt=\"inspectfiles\" width=\"842\" height=\"561\" srcset=\"https:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/inspectfiles.png 842w, https:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/inspectfiles-300x200.png 300w\" sizes=\"(max-width: 842px) 100vw, 842px\" \/><\/a><\/p>\n<p>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&#8217;s a folder with the same name as your upload, in my case it&#8217;s called SiteUpload.<\/p>\n<p><a href=\"http:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/exportedfile.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-392\" src=\"http:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/exportedfile.png\" alt=\"exportedfile\" width=\"615\" height=\"126\" srcset=\"https:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/exportedfile.png 615w, https:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/exportedfile-300x61.png 300w\" sizes=\"(max-width: 615px) 100vw, 615px\" \/><\/a><\/p>\n<p>In that folder there&#8217;s a folder structure similar to the one on the site. Just navigate through the folders and there&#8217;s your files!<\/p>\n<p><a href=\"http:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/files.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-395\" src=\"http:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/files.png\" alt=\"files\" width=\"578\" height=\"409\" srcset=\"https:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/files.png 578w, https:\/\/jonika.nu\/JonasBlogg\/wp-content\/uploads\/2015\/10\/files-300x212.png 300w\" sizes=\"(max-width: 578px) 100vw, 578px\" \/><\/a><\/p>\n<a href=\"https:\/\/twitter.com\/jonlin76\" class=\"twitter-follow-button\" data-show-count=\"false\" data-size=\"small\">Follow jonlin76<\/a>\n<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=\/^http:\/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+':\/\/platform.twitter.com\/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');<\/script>","protected":false},"excerpt":{"rendered":"<p>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 &#8220;Export&#8221;-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 &hellip; <a href=\"https:\/\/jonika.nu\/JonasBlogg\/archives\/384\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">EPiServer CMS 6: Exporting lots and lots of files<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[83,75,84],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/jonika.nu\/JonasBlogg\/wp-json\/wp\/v2\/posts\/384"}],"collection":[{"href":"https:\/\/jonika.nu\/JonasBlogg\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jonika.nu\/JonasBlogg\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jonika.nu\/JonasBlogg\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jonika.nu\/JonasBlogg\/wp-json\/wp\/v2\/comments?post=384"}],"version-history":[{"count":8,"href":"https:\/\/jonika.nu\/JonasBlogg\/wp-json\/wp\/v2\/posts\/384\/revisions"}],"predecessor-version":[{"id":486,"href":"https:\/\/jonika.nu\/JonasBlogg\/wp-json\/wp\/v2\/posts\/384\/revisions\/486"}],"wp:attachment":[{"href":"https:\/\/jonika.nu\/JonasBlogg\/wp-json\/wp\/v2\/media?parent=384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jonika.nu\/JonasBlogg\/wp-json\/wp\/v2\/categories?post=384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jonika.nu\/JonasBlogg\/wp-json\/wp\/v2\/tags?post=384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}