iredmail-doc/html/upgrade.iredapd.html

114 lines
5.0 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Upgrade iRedAPD</title>
<link rel="stylesheet" type="text/css" href="./css/markdown.css" />
</head>
<body>
<div id="navigation">
<a href="http://www.iredmail.org" target="_blank">iRedMail web site</a>
// <a href="./index.html">Document Index</a>
</div><h1 id="upgrade-iredapd">Upgrade iRedAPD</h1>
<blockquote>
<p>Release Notes are available here: <a href="./iredapd.releases.html">iRedAPD Release Notes</a>.</p>
<p>If you're trying to upgrade iRedAPD-1.3.x or earlier releases to the latest
iRedAPD, please check this tutorial instead:
<a href="./upgrade.old.iredapd.html">Upgrade iRedAPD from v1.3.x or earlier versions to latest release</a>.</p>
<p>We offer remote upgrade service, check <a href="../support.html">the price</a> and <a href="../contact.html">contact us</a>.</p>
</blockquote>
<p>This tutorial describes how to upgrade iRedAPD from <code>1.4.0</code> or later releases
to the latest stable release. It's applicable on all Linux/BSD distributions
supported by iRedMail.</p>
<ul>
<li>Download the latest stable release here: <a href="http://www.iredmail.org/yum/misc/">http://www.iredmail.org/yum/misc/</a>
For example, iRedAPD-1.6.0.tar.bz2.</li>
<li>Upload it to your iRedMail server. Assume it's <code>/root/iRedAPD-1.6.0.tar.bz2</code>.</li>
<li>Extract downloaded package and execute upgrade script:</li>
</ul>
<pre><code># cd /root
# tar xjf iRedAPD-1.6.0.tar.bz2
# cd iRedAPD-1.6.0/tools/
# bash upgrade_iredapd.sh
</code></pre>
<p>That's all.</p>
<hr />
<p>If you're upgrading iRedAPD-1.6.0 (or older release) to iRedAPD-1.7.0 (or newer
release), please create new SQL database <code>iredapd</code> with sql commands below:</p>
<blockquote>
<p>Note: You can create a strong password for SQL user with command:
<code>eval &lt;/dev/urandom tr -dc A-Za-z0-9 | (head -c $1 &amp;&gt;/dev/null || head -c 30)</code></p>
</blockquote>
<ul>
<li>For OpenLDAP, MySQL, MariaDB backends, please login to SQL server as <code>root</code>
user, then create required database (replace sample password <code>passwd</code> in
sql command by the strong password you generated):</li>
</ul>
<pre><code>$ mysql -u root -p
sql&gt; CREATE DATABASE IF NOT EXISTS iredapd DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
sql&gt; USE iredapd;
sql&gt; SOURCE /opt/iredapd/SQL/iredapd.mysql;
sql&gt; GRANT ALL ON iredapd.* TO &quot;iredapd&quot;@&quot;localhost&quot; IDENTIFIED BY &quot;passwd&quot;;
sql&gt; FLUSH PRIVILEGES;
</code></pre>
<p>Now update iRedAPD SQL database name, sql user name, and password in iRedAPD
config file <code>/opt/iredapd/settings.py</code> (all parameters start with <code>iredapd_db_</code>).</p>
<ul>
<li>For PostgreSQL backend, please copy <code>/opt/iredapd/SQL/iredapd.pgsql</code> to <code>/tmp</code>
first, then switch to system user <code>postgres</code> (It's <code>_postgresql</code> on OpenBSD)
with <code>su</code> command, execute sql commands below:</li>
</ul>
<pre><code># cp /opt/iredapd/SQL/iredapd.pgsql /tmp/
# chmod 0755 /tmp/iredapd.pgsql
---- Switch to system user `postgres` here ----
$ psql
-- Create database
sql&gt; CREATE DATABASE iredapd WITH TEMPLATE template0 ENCODING 'UTF8';
-- Create user
sql&gt; CREATE USER iredapd WITH ENCRYPTED PASSWORD 'passwd' NOSUPERUSER NOCREATEDB NOCREATEROLE;
sql&gt; ALTER DATABASE iredapd OWNER TO iredapd;
-- Import SQL template
sql&gt; \c iredapd;
sql&gt; \i /tmp/iredapd.pgsql;
-- Grant permissions
sql&gt; GRANT ALL ON throttle,throttle_tracking TO iredapd;
sql&gt; GRANT ALL ON throttle_id_seq,throttle_tracking_id_seq TO iredapd;
</code></pre>
<p>Now update iRedAPD SQL database name, sql user name, and password in iRedAPD
config file <code>/opt/iredapd/settings.py</code> (all parameters start with <code>iredapd_db_</code>).</p>
<hr />
<p>Important notes:</p>
<ul>
<li>
<p>It's recommended to enable plugin <code>reject_null_sender</code> in iRedAPD-1.4.4 or
newer releases to prevent authenticated user sending spam as null sender.</p>
</li>
<li>
<p>Plugin <code>amavisd_wblist</code> is required if you manage white/blacklists with
iRedAdmin-Pro.</p>
</li>
</ul>
<h1 id="see-also">See Also</h1>
<ul>
<li>iRedAPD source code is hosted on <a href="https://bitbucket.org/zhb/iredapd/">BitBucket</a>.</li>
</ul><p style="text-align: center; color: grey;">Document published under a <a href="http://creativecommons.org/licenses/by-nd/3.0/us/" target="_blank">CC BY-ND 3.0</a> license. If you found something wrong, please do <a href="http://www.iredmail.org/contact.html">contact us</a> to fix it.<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-3293801-21', 'auto');
ga('send', 'pageview');
</script>
</body></html>