<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Backup function code analysis]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=6405</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6405&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Backup function code analysis.]]></description>
		<lastBuildDate>Mon, 08 Aug 2016 10:10:41 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Backup function code analysis]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25983#p25983</link>
			<description><![CDATA[<p>The <a href="https://frontaccounting.com/fawiki/index.php?n=Help.BackupAndRestoreDatabase">Wiki</a> has this post&#039;s contents.</p><p><strong>Backup Code Analysis</strong></p><ul><li><p>The key file where the backup originates is <strong>admin/db/maintenance_db.inc</strong></p></li><li><p>In it, the key function that starts the backup is <em>function <strong>db_backup()</strong></em></p><ul><li><p>Parameter <strong>$tbpref</strong> makes it generic enabling usage of other prefixes possibly within extensions or in customisations</p></li><li><p>Creates the name of the backup sql file and goes to <em>function <strong>db_export()</strong></em></p></li></ul></li><li><p>The actual backing up is done in the <em>function <strong>db_export()</strong></em> </p><ul><li><p>Parameter <strong>$tbpref</strong> makes it generic enabling usage of other prefixes possibly within extensions or in customisations</p></li><li><p>If no prefix is there for a company and other companies data resides in the same db, then all tables in the db <em>including those of other companies in it too will get backed up!</em></p></li><li><p>Sets <strong>max chunk size</strong> before writing to sql backup file to <strong>2MB</strong> or if present, from <strong>memory_limit</strong> value in <strong>php.ini</strong></p></li><li><p>Writes standard parameters to sql backup as <strong>comments</strong></p></li><li><p>Writes <em>user comments</em> to sql backup as <strong>comments</strong></p></li><li><p>Acquire all table names in db and shortlist them based <em>on prefix</em> or <strong><em>all</em></strong><em> on no prefix</em>!</p></li><li><p>SQL comment character hardcoded as &quot;#&quot; throughout</p></li></ul></li></ul><p>If your backup is taking too long, then tune the MySQL server with <strong>mysqltuner</strong>. In debian, install with <strong>apt-get install mysqltuner</strong>. Usage: </p><div class="codebox"><pre><code>mysqlcheck -o mydbname
mysqltuner</code></pre></div><p>and monitor with: </p><div class="codebox"><pre><code>tail -fn0 /var/log/mysql.err
tail -n15 /var/log/mysql.err
vmstat 5 5</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 08 Aug 2016 10:10:41 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25983#p25983</guid>
		</item>
	</channel>
</rss>
