Addition/Migrate.to.New.iRedMail.Server

From iRedMail
(Difference between revisions)
Jump to: navigation, search
(Migrate mailboxes (in maildir format))
 
(Client settings (Outlook, Thunderbird))
 
(11 intermediate revisions by one user not shown)
Line 5: Line 5:
 
'''Please try it on a test server first, if it works well, then try it on product server.'''
 
'''Please try it on a test server first, if it works well, then try it on product server.'''
  
Since new iRedMail server will install same components as old server, you
+
Since new iRedMail server will install same components as old server, you can choose what data you want to migrate. The core data are mail accounts, user mailboxes, roundcube webmail database, Policyd database, Amavisd database.
can choose what data you want to migrate. The major data are mail accounts, user mailboxes, roundcube webmail database, Policyd database, Amavisd database.
+
  
 +
WARNING: Do not restore database "mysql" exported from old server, it contains SQL usernames/passwords for Roundcube/Amavisd/Policyd/Cluebringer used on old server. New iRedMail server has the same SQL usernames, but different passwords. So please do not restore it.
 +
 +
== Client settings (Outlook, Thunderbird) ==
 +
 +
* Upcoming iRedMail-0.8.7 enforces secure smtp connection, client must issue 'STARTTLS' command before authentication, so you must change your mail client program (e.g. Outlook, Thunderbird) to use TLS connection on port 587. If you want to enable smtp authentication on port 25 (again, not recommended), please comment out Postfix parameter '''"smtpd_tls_auth_only = yes"''' in its config file /etc/postfix/main.cf.
  
 
== LDAP: migrate mail accounts ==
 
== LDAP: migrate mail accounts ==
Line 18: Line 22:
  
 
'''Note''':
 
'''Note''':
* There might be some changes in LDAP schema, please read all upgrade tutorials for your running iRedMail version, then apply LDAP data related upgradings. For example:
+
* There might be some changes in LDAP schema, please find scripts in below URL to apply all required changes: https://bitbucket.org/zhb/iredmail/src/default/extra/update/
** http://iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.5.1-0.6.0#Add_missing_values
+
** http://iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.6.1-0.7.0#Add_missing_value_for_mail_users
+
 
* You can find all upgrade tutorials of iRedMail here: http://www.iredmail.org/doc.html#upgrade_tutorial
 
* You can find all upgrade tutorials of iRedMail here: http://www.iredmail.org/doc.html#upgrade_tutorial
  
== MySQL: Migrate mail accounts ==
+
== MySQL/PostgreSQL: Migrate mail accounts ==
  
 
All mail accounts are stored in database '''vmail''' by default, to migrate mail accounts, just simply export this database on old server, then import it on new server.
 
All mail accounts are stored in database '''vmail''' by default, to migrate mail accounts, just simply export this database on old server, then import it on new server.
  
'''Note''': There might be some changes in SQL structure, please read all upgrade tutorials for your running iRedMail version, then apply SQL structure related upgradings. For example:
+
* '''IMPORTANT NOTE''': Upcoming release iRedMail-0.8.7 drops two SQL columns: '''mailbox.bytes''', '''mailbox.messages'''. So before you import backup SQL database, please add them first. It's safe to drop them after you imported database.
* http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.7.4-0.8.0#Add_internal_service_required_by_Doveadm_2
+
{{cmd|<pre>
 +
mysql> USE vmail;
 +
mysql> ALTER TABLE mailbox ADD COLUMN bytes BIGINT(20) NOT NULL DEFAULT 0;
 +
mysql> ALTER TABLE mailbox ADD COLUMN messages BIGINT(20) NOT NULL DEFAULT 0;
 +
</pre>}}
 +
 
 +
* '''IMPORTANT NOTE''': There might be some changes in SQL structure, please read all upgrade tutorials for your running iRedMail version, then apply SQL structure related upgradings. For example: http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedMail/0.7.4-0.8.0#Add_internal_service_required_by_Doveadm_2
  
 
== Migrate mailboxes (in maildir format) ==
 
== Migrate mailboxes (in maildir format) ==
Line 48: Line 56:
 
* Export/import roundcube webmail database, and upgrade database to work with new version of Roundcube.
 
* Export/import roundcube webmail database, and upgrade database to work with new version of Roundcube.
 
http://trac.roundcube.net/wiki/Howto_Upgrade
 
http://trac.roundcube.net/wiki/Howto_Upgrade
 +
 +
'''IMPORTANT NOTES'''
 +
* Upcoming iRedMail-0.8.7 enforces secure smtp connection. client must issue 'STARTTLS' command to establish secure smtp connection before authentication, otherwise you will get '''"SMTP error: Authentication failure"''' in Roundcube while sending email. To fix this error, you have to change smtp server address and port to below settings:
 +
{{cfg|config/config.inc.php|<pre>
 +
// Settings for Roundcube webmail 1.0.0 and later releases
 +
$config['smtp_server'] = 'tls://127.0.0.1';
 +
$config['smtp_port'] = 587;
 +
</pre>}}
  
 
== Migrate Policyd database ==
 
== Migrate Policyd database ==
  
 
Policyd database stores blacklist/whitelist, throttling, etc. To migrate its data, simply export this database on old server, then import it on new server.
 
Policyd database stores blacklist/whitelist, throttling, etc. To migrate its data, simply export this database on old server, then import it on new server.

Latest revision as of 06:55, 12 April 2014

Contents


TO BE CONTINUED.

Please try it on a test server first, if it works well, then try it on product server.

Since new iRedMail server will install same components as old server, you can choose what data you want to migrate. The core data are mail accounts, user mailboxes, roundcube webmail database, Policyd database, Amavisd database.

WARNING: Do not restore database "mysql" exported from old server, it contains SQL usernames/passwords for Roundcube/Amavisd/Policyd/Cluebringer used on old server. New iRedMail server has the same SQL usernames, but different passwords. So please do not restore it.

[edit] Client settings (Outlook, Thunderbird)

  • Upcoming iRedMail-0.8.7 enforces secure smtp connection, client must issue 'STARTTLS' command before authentication, so you must change your mail client program (e.g. Outlook, Thunderbird) to use TLS connection on port 587. If you want to enable smtp authentication on port 25 (again, not recommended), please comment out Postfix parameter "smtpd_tls_auth_only = yes" in its config file /etc/postfix/main.cf.

[edit] LDAP: migrate mail accounts

Steps to migrate LDAP mail accounts:

  • Setup a new server with the latest iRedMail, and make iRedAdmin-Pro-LDAP work as expected.
  • Export mail accounts from LDAP on OLD mail server.

Normally, LDAP data can be exported into LDIF format. Here's backup/export script: http://www.iredmail.org/wiki/index.php?title=IRedMail/FAQ/Backup

Note:

[edit] MySQL/PostgreSQL: Migrate mail accounts

All mail accounts are stored in database vmail by default, to migrate mail accounts, just simply export this database on old server, then import it on new server.

  • IMPORTANT NOTE: Upcoming release iRedMail-0.8.7 drops two SQL columns: mailbox.bytes, mailbox.messages. So before you import backup SQL database, please add them first. It's safe to drop them after you imported database.
Terminal:
mysql> USE vmail;
mysql> ALTER TABLE mailbox ADD COLUMN bytes BIGINT(20) NOT NULL DEFAULT 0;
mysql> ALTER TABLE mailbox ADD COLUMN messages BIGINT(20) NOT NULL DEFAULT 0;

[edit] Migrate mailboxes (in maildir format)

  • Simply copy all mailboxes (in maildir format) to new iRedMail server.
  • Set correct file owner of mailboxes. Default is owned by user vmail, group vmail.
  • Set correct file permission of mailboxes. Default is 0700.

WARNING: please make sure maildir path which stored/configured in LDAP will match the real path on file system, so that mail clients can find them.

[edit] Important Notes for MySQL backend

This section is applicable to iRedMail-0.7.3 and earlier versions, with MySQL backend. Not required in iRedMail-0.7.4 and later versions.

Please refer to this section for more details: Store realtime mailbox quota usage in seperate SQL table

[edit] Migrate Roundcube webmail data

  • Export/import roundcube webmail database, and upgrade database to work with new version of Roundcube.

http://trac.roundcube.net/wiki/Howto_Upgrade

IMPORTANT NOTES

  • Upcoming iRedMail-0.8.7 enforces secure smtp connection. client must issue 'STARTTLS' command to establish secure smtp connection before authentication, otherwise you will get "SMTP error: Authentication failure" in Roundcube while sending email. To fix this error, you have to change smtp server address and port to below settings:
File: config/config.inc.php
// Settings for Roundcube webmail 1.0.0 and later releases
$config['smtp_server'] = 'tls://127.0.0.1';
$config['smtp_port'] = 587;

[edit] Migrate Policyd database

Policyd database stores blacklist/whitelist, throttling, etc. To migrate its data, simply export this database on old server, then import it on new server.

Personal tools