<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to mirror document library to the external drive? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-mirror-document-library-to-the-external-drive/m-p/106998#M30181</link>
    <description>&lt;P&gt;Thank you for such an extensive answer. I tried to implement option nr. 2 -&amp;nbsp; script in Python3 using your cmislib3 (unfortunately, I can find docs only for cmislib &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; ).&lt;/P&gt;&lt;P&gt;It is easy to traverse through directories but I can't download files.&lt;/P&gt;&lt;P&gt;This is the code I use:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;content = repo.getObjectByPath("/Sites/test/test.png")&lt;BR /&gt;o = &lt;SPAN&gt;open&lt;/SPAN&gt;(content.getName()&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'wb'&lt;/SPAN&gt;)&lt;BR /&gt;result = content.getContentStream()&lt;BR /&gt;o.write(result.read())&lt;BR /&gt;result.close()&lt;BR /&gt;o.close()&lt;/PRE&gt;&lt;P&gt;The downloaded file has a size of 0 bytes... (result is str, not binary so it throws an error, I can change 'wb' to 'w', but then the binary files are invalid)&lt;/P&gt;&lt;P&gt;EDIT. It looks like Python3.8 in incompatible.&lt;/P&gt;&lt;P&gt;EDIT2. In the binding.py you have to replace 1938-19340 lines with&amp;nbsp; 'return io.BytesIO(result.content)'&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jul 2020 08:25:58 GMT</pubDate>
    <dc:creator>upforsin</dc:creator>
    <dc:date>2020-07-01T08:25:58Z</dc:date>
    <item>
      <title>How to mirror document library to the external drive?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-mirror-document-library-to-the-external-drive/m-p/106996#M30179</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I would like to mirror document library files and folder structure to the backup drive every night (so downloading whole document library is not an option). How can I do it?&lt;/P&gt;&lt;P&gt;Alfresco stores files in different structures and with different names so it is impossible to just copy files.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 13:39:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-mirror-document-library-to-the-external-drive/m-p/106996#M30179</guid>
      <dc:creator>upforsin</dc:creator>
      <dc:date>2020-06-26T13:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to mirror document library to the external drive?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-mirror-document-library-to-the-external-drive/m-p/106997#M30180</link>
      <description>&lt;P&gt;The best backup approach is to (1) dump your database and then (2) backup your entire content store directory.&lt;/P&gt;
&lt;P&gt;However, if you want to mirror your document library to an external drive, there are several ways to do it...&lt;/P&gt;
&lt;P&gt;1. Your document library is accessible via WebDAV. You could mount it as a drive, then use rsync to copy it to a backup volume. Obviously you will not get the metadata or the version history if you go this route.&lt;/P&gt;
&lt;P&gt;2. You could write a script that uses the REST API or CMIS to crawl the document library and write new and updated files to the backup volume.&lt;/P&gt;
&lt;P&gt;3. You could use behaviors to track when files are new or updated and then put a message on a queue. In a separate process, have Java code that subscribes to the queue and when it seems an event, fetch the file via a REST API or CMIS and write it to the backup volume.&lt;/P&gt;
&lt;P&gt;I've successfully used option 3 for a client. We added UI actions to Share that allow authorized end-users to "flag" a document for backup. It works as described above, but instead of watching for any create/update, the behavior watches for the presence of a "marker" aspect that indicates the file should be archived.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 18:25:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-mirror-document-library-to-the-external-drive/m-p/106997#M30180</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2020-06-29T18:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to mirror document library to the external drive?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-mirror-document-library-to-the-external-drive/m-p/106998#M30181</link>
      <description>&lt;P&gt;Thank you for such an extensive answer. I tried to implement option nr. 2 -&amp;nbsp; script in Python3 using your cmislib3 (unfortunately, I can find docs only for cmislib &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; ).&lt;/P&gt;&lt;P&gt;It is easy to traverse through directories but I can't download files.&lt;/P&gt;&lt;P&gt;This is the code I use:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;content = repo.getObjectByPath("/Sites/test/test.png")&lt;BR /&gt;o = &lt;SPAN&gt;open&lt;/SPAN&gt;(content.getName()&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'wb'&lt;/SPAN&gt;)&lt;BR /&gt;result = content.getContentStream()&lt;BR /&gt;o.write(result.read())&lt;BR /&gt;result.close()&lt;BR /&gt;o.close()&lt;/PRE&gt;&lt;P&gt;The downloaded file has a size of 0 bytes... (result is str, not binary so it throws an error, I can change 'wb' to 'w', but then the binary files are invalid)&lt;/P&gt;&lt;P&gt;EDIT. It looks like Python3.8 in incompatible.&lt;/P&gt;&lt;P&gt;EDIT2. In the binding.py you have to replace 1938-19340 lines with&amp;nbsp; 'return io.BytesIO(result.content)'&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 08:25:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-mirror-document-library-to-the-external-drive/m-p/106998#M30181</guid>
      <dc:creator>upforsin</dc:creator>
      <dc:date>2020-07-01T08:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to mirror document library to the external drive?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-mirror-document-library-to-the-external-drive/m-p/106999#M30182</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/8063"&gt;@upforsin&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;Just to clarify - if you make the change in EDIT2 can you now download successfully? If so, is this problem now solved?&lt;/P&gt;
&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 12:04:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-mirror-document-library-to-the-external-drive/m-p/106999#M30182</guid>
      <dc:creator>EddieMay</dc:creator>
      <dc:date>2020-07-01T12:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to mirror document library to the external drive?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-mirror-document-library-to-the-external-drive/m-p/107000#M30183</link>
      <description>&lt;P&gt;Yes, thanks to&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/70191"&gt;@jpotts&lt;/A&gt;&amp;nbsp;I successfully managed to copy document structure to FTP.&lt;/P&gt;&lt;P&gt;First, I tried option nr. 3 - 3 days of writing Python code, I managed to download files (after modifying CMIS library) but then I couldn't upload some files to FTP (because binary files had chars incompatible with Latin encoding *??).&lt;/P&gt;&lt;P&gt;Then, in 10 minutes I implemented option nr. 1 using WebDAV and lftp. Thank you once again, Jeff!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;*Python error: Unresolved “UnicodeEncodeError: 'latin-1' codec can't encode characters in position xxx: ordinal not in range(256)”&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Here is the script if anyone were interested:&amp;nbsp;&lt;A href="https://pastebin.com/srfbtvJT" target="_blank" rel="nofollow noopener noreferrer"&gt;https://pastebin.com/srfbtvJT&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jul 2020 15:10:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-mirror-document-library-to-the-external-drive/m-p/107000#M30183</guid>
      <dc:creator>upforsin</dc:creator>
      <dc:date>2020-07-04T15:10:46Z</dc:date>
    </item>
  </channel>
</rss>

