1

Topic: moving iRedMail installation from Ubuntu to Debian

==== Required information ====
- iRedMail version: 0.8.7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Debian 7.5 i386
- Related log if you're reporting an issue
====

I previously posted regarding installing iRedMail on Debian 7.5. Problem has been resolved and am now attempting to backup the entire iRedMail configuration from my previous installation on Ubuntu and get it imported into the newer installation on Debian.

I performed the backup in this manner:
1.    used /root/iRedMail/tools/backup_MySQL.sh to do the backup of the databases
2.    backed up everything in the /var/vmail/ directory
3.    backed up everything in the /etc/postfix/mysql directory
4.    backed up /etc/dovecot/dovecot-mysql.conf file

Attempted to restore by:
1.    using phpMyAdmin to restore the databases
2.    replaced the /var/vmail/ directory contents with the earlier backup
3.    replaced the /etc/postfix/mysql directory contents with the earlier backup
4.    replaced the /etc/dovecot/dovecot-mysql.conf file

I guess I must be missing one or more items or did something incorrectly because:

When I attempt to log in to roundcube mail, I get the following message (instead of the login screen):
DATABASE ERROR: CONNECTION FAILED!  Unable to connect to the database! Please contact your server-administrator

In an attempt to rectify the above, I copied over the contents of /usr/share/apache2/roundcubemail-1.0.1/config (from the older installation into the newer installation)

Now I get this message instead:
CONFIGURATION ERROR
config.inc.php was not found.
Please read the INSTALL instructions!

Any help is much appreciated!

2

Re: moving iRedMail installation from Ubuntu to Debian

Please check this wiki tutorial for reference:
http://www.iredmail.org/wiki/index.php? … ail.Server

ssisle wrote:

3.    backed up everything in the /etc/postfix/mysql directory
4.    backed up /etc/dovecot/dovecot-mysql.conf file

You don't need them. a new iRedMail installation will generate these files with correct SQL username/password, if you restore old files on new server, you have to update SQL username/passwords in these files.

3

Re: moving iRedMail installation from Ubuntu to Debian

Hi again, I followed the instructions in the link you provided.

Did not replace the /etc/postfix/mysql and /etc/dovecot/ files this time round.

The roundcube webmail login shows up fine but any attempt to log into any account fails with the following message:
"Connection to storage server failed."


I'm not sure if it's related, but my installation of Debian does not have a user account of the same name as my installation of Ubuntu. Would that make a difference?

4

Re: moving iRedMail installation from Ubuntu to Debian

ssisle wrote:

The roundcube webmail login shows up fine but any attempt to log into any account fails with the following message:
"Connection to storage server failed."

Any related log in Dovecot log files?

ssisle wrote:

I'm not sure if it's related, but my installation of Debian does not have a user account of the same name as my installation of Ubuntu. Would that make a difference?

What user account? The mail user you used to login?
Did you restore mail accounts (SQL database "vmail")?

5

Re: moving iRedMail installation from Ubuntu to Debian

ZhangHuangbin wrote:
ssisle wrote:

The roundcube webmail login shows up fine but any attempt to log into any account fails with the following message:
"Connection to storage server failed."

Any related log in Dovecot log files?

ssisle wrote:

I'm not sure if it's related, but my installation of Debian does not have a user account of the same name as my installation of Ubuntu. Would that make a difference?

What user account? The mail user you used to login?
Did you restore mail accounts (SQL database "vmail")?

I restored amavisd, iredadmin, roundcubemail, and vmail. The only database I didn't restore is mySql.

Sorry, I was referring to the Linux user / system login unrelated to iRedMail.

Have not yet checked the dovecot log files but will look up where they are and post what I find

6

Re: moving iRedMail installation from Ubuntu to Debian

iRedMail will create required system accounts (vmail, iredapd, iredadmin) during installation, some binary packages will create required system accounts too, e.g. Postfix, Dovecot. iRedMail doesn't need or create other system accounts.

7

Re: moving iRedMail installation from Ubuntu to Debian

Checked the dovecot log file and found it was related to permissions.
did chmod and chown on /var/vmail earlier but it was non-recursive and the subfolders were still owned by root.

The following fixed it for me:

chown -R vmail.vmail /var/vmail
chmod -R 700 /var/vmail


Thanks Zhang.