<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Cloning a folder getting increasingly slower]]></title><description><![CDATA[<p>I have a default set of templates in a folder structure, that I want duplicated for each new user.</p>
<p>I'm currently creating a new folder and then using the <code>/studio/hierarchyMove</code> endpoint to &quot;clone&quot; from the source folder into the new folder, e.g.</p>
<pre><code class="language-js">// Do the clone - from the existing folder to the newly created folder
const cloneUrl = `${jsReportSettings.url}/studio/hierarchyMove`;
const clonePayload = {
  source: {
	id: jsReportSettings.cloneFolderId,
	entitySet: &quot;folders&quot;,
	onlyChildren: true,
  },
  target: {
	shortid: newFolderResult.shortid,
	updateReferences: true,
  },
  copy: true,
  replace: false,
};
</code></pre>
<p>(Not sure if there's a better approach, I got the above from examining the network calls when cloning a folder in the Studio...)</p>
<p>This does work, but I have an issue where the cloning process as outlined above is taking longer and longer with each new user.</p>
<p>Any ideas?  Is there a better way to &quot;clone&quot; a folder?  I couldn't find any documentation on the <code>/studio/hierarchyMove</code> endpoint, so not sure what the parameters do and if there's an option there that might help - <code>updateReferences</code> maybe?</p>
<p>Also, I'm currently using the file system - default <code>jsreport-fs-store</code> - for this (running a Docker image on Azure Container Apps with a &quot;Premium&quot; performance storage account - SSD backed).</p>
<p>Would switching to using a database backed store be faster, e.g. MongoDB or Postgres?  Are there any benchmarks around what's fastest?</p>
]]></description><link>https://forum.jsreport.net/topic/3050/cloning-a-folder-getting-increasingly-slower</link><generator>RSS for Node</generator><lastBuildDate>Sat, 17 Oct 2026 06:54:12 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/3050.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 10 Jan 2024 23:15:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Cloning a folder getting increasingly slower on Invalid Date]]></title><description><![CDATA[<p>I have a default set of templates in a folder structure, that I want duplicated for each new user.</p>
<p>I'm currently creating a new folder and then using the <code>/studio/hierarchyMove</code> endpoint to &quot;clone&quot; from the source folder into the new folder, e.g.</p>
<pre><code class="language-js">// Do the clone - from the existing folder to the newly created folder
const cloneUrl = `${jsReportSettings.url}/studio/hierarchyMove`;
const clonePayload = {
  source: {
	id: jsReportSettings.cloneFolderId,
	entitySet: &quot;folders&quot;,
	onlyChildren: true,
  },
  target: {
	shortid: newFolderResult.shortid,
	updateReferences: true,
  },
  copy: true,
  replace: false,
};
</code></pre>
<p>(Not sure if there's a better approach, I got the above from examining the network calls when cloning a folder in the Studio...)</p>
<p>This does work, but I have an issue where the cloning process as outlined above is taking longer and longer with each new user.</p>
<p>Any ideas?  Is there a better way to &quot;clone&quot; a folder?  I couldn't find any documentation on the <code>/studio/hierarchyMove</code> endpoint, so not sure what the parameters do and if there's an option there that might help - <code>updateReferences</code> maybe?</p>
<p>Also, I'm currently using the file system - default <code>jsreport-fs-store</code> - for this (running a Docker image on Azure Container Apps with a &quot;Premium&quot; performance storage account - SSD backed).</p>
<p>Would switching to using a database backed store be faster, e.g. MongoDB or Postgres?  Are there any benchmarks around what's fastest?</p>
]]></description><link>https://forum.jsreport.net/post/13081</link><guid isPermaLink="true">https://forum.jsreport.net/post/13081</guid><dc:creator><![CDATA[edlaver]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Cloning a folder getting increasingly slower on Invalid Date]]></title><description><![CDATA[<p>The <code>hierarchyMove</code> uses transactions for the data consistency. Unfortunately, transactions in the fs store a currently poorly implemented regarding performance. With a lot of data in store, it will always need to do many copy operations which can be time-consuming with slower disks.</p>
<p>Switching to the full-blown database will make a big difference.<br />
The jsreport is tested well with mongo, we use it in all our services.</p>
]]></description><link>https://forum.jsreport.net/post/13086</link><guid isPermaLink="true">https://forum.jsreport.net/post/13086</guid><dc:creator><![CDATA[admin]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Cloning a folder getting increasingly slower on Invalid Date]]></title><description><![CDATA[<p>Ah makes sense, thanks very much <a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/1">@admin</a>.</p>
<p>Am in the midst of migrating to Mongo now, so hopefully that'll help matters!</p>
]]></description><link>https://forum.jsreport.net/post/13088</link><guid isPermaLink="true">https://forum.jsreport.net/post/13088</guid><dc:creator><![CDATA[edlaver]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Cloning a folder getting increasingly slower on Invalid Date]]></title><description><![CDATA[<p>Just wanted to say thanks <a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/1">@admin</a>, moving to Mongo brought down the folder cloning from upwards of 2 mins down to 11secs!  UI and API seems much snappier as well.</p>
<p>(Note: Am using MongoDB Atlas Serverless, seems to work fine so far.)</p>
<p>One thing I found was that using a US database from the UK for development was crazy slow, presumably my internet connection or latency or something, but when I connected from the Docker image hosted in the same region, it was all good.</p>
<p>Next up, migrating the rendered reports. :)</p>
]]></description><link>https://forum.jsreport.net/post/13098</link><guid isPermaLink="true">https://forum.jsreport.net/post/13098</guid><dc:creator><![CDATA[edlaver]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>