1

Topic: Migration questions

============ Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.8
- Linux/BSD distribution name and version: CentOS 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro?: Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I am preparing for a migration from iRedMail 0.8.5 to 0.9.8. (Yes, big jump, but I have learnt my lesson.) So far the preparations are going well, although they're behind schedule.

I feel that I should first thank Zhang for saving me a bunch of time by taking care of the installation. His help is worth the cost. I'm impatient sometimes, but his documentation is first class, and so is his product.

I have a few questions as I'm going along:

  1. Can I prevent a domain admin from changing the quota of an account at all, or can I only prevent him from going above a certain limit?

  2. Is there somewhere I can change the default quota for a new account, either globally or on a per-domain basis?

  3. I noticed reference in a configuration file somewhere (possibly Nginx) to hosting iRedAdmin and webmail on their own domains. I'm not familiar with Nginx, having used Apache for years. Has anyone done something like put iRedAdmin on admin.example.com and the webmail on webmail.exmple.com?

  4. Speaking of Roundcube, if I import the roundcube database from the old server and then run the current version of Roundcube on the new server, will it automatically upgrade the old database? The information at https://github.com/roundcube/roundcubemail/wiki/Upgrade seems to hint it will, but it's not clear.

Thanks.


Craig

2

Re: Migration questions

craig wrote:
  1. Can I prevent a domain admin from changing the quota of an account at all, or can I only prevent him from going above a certain limit?

  2. Is there somewhere I can change the default quota for a new account, either globally or on a per-domain basis?

  3. I noticed reference in a configuration file somewhere (possibly Nginx) to hosting iRedAdmin and webmail on their own domains. I'm not familiar with Nginx, having used Apache for years. Has anyone done something like put iRedAdmin on admin.example.com and the webmail on webmail.exmple.com?

  4. Speaking of Roundcube, if I import the roundcube database from the old server and then run the current version of Roundcube on the new server, will it automatically upgrade the old database? The information at https://github.com/roundcube/roundcubemail/wiki/Upgrade seems to hint it will, but it's not clear.

1)

The latter one. With iRedAdmin-Pro, you can set a quota for domain, and domain admin is free to balance the mailbox quota for different users, but not exceed the domain quota.

Curious why you want to prevent quota change by domain admin for one account? if you don't mind sharing.

2)

Sure. Login to iRedAdmin-Pro as global admin, go to domain profile page.

3)

It's easy, create a new config file under /etc/nginx/sites-available/ for your web domain "example.com" like this:

server {
    listen 80;
    server_name example.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443;
    server_name example.com;

    root /var/www/html;
    index index.php index.html;

    include /etc/nginx/templates/misc.tmpl;
    include /etc/nginx/templates/ssl.tmpl;
    include /etc/nginx/templates/roundcube-subdomain.tmpl;
    include /etc/nginx/templates/iredadmin-subdomain.tmpl;
}

Don't forget to link this file to /etc/nginx/sites-enabled/, otherwise it's not loaded by Nginx.

4)

Depends on how you upgrade Roundcube. If you follow section "On the command line", and upgrade with command "bin/installto.sh", it will upgrade the SQL database. Note: this requires you have old Roundcube directory and database on new server.

Another way is, import the SQL files under "SQL/mysql/<xxx>.sql" manually. You can query SQL table "roundcubemail.system" on OLD server to know the version (of SQL structure) it runs, then find newer SQL files under "SQL/mysql/" and import them manually (the sql file names contains year, month, day, you won't miss it).

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3

Re: Migration questions

Thanks Zhang. Appreciate your thorough response.

ZhangHuangbin wrote:

Curious why you want to prevent quota change by domain admin for one account? if you don't mind sharing.

I am considering changing our rates based on the size of the email account, so the problem I see is this: If a domain user starts with nine 2 GB accounts and one 5 GB account, the "Max quota of mail user" for the domain must be 5 GB. If I set the "Domain quota size" to (in this example, 9x2+5=) 23 GB, this means that the domain user could theoretically reduce the quotas of (let's say) six of his small accounts to 0.5 GB and increase the quotas of three of his accounts to 5 GB. So with the other 5 GB account, he now has four 5 GB accounts (20 GB) and six 0.5 GB accounts (3 GB), which still adds up to ([4x5]+[6x0.5]=) 23 GB, but he gets three "big" accounts without having to pay extra for them.

Of course, I could charge based on total disk usage for the domain, but that's not my first choice. But I see advantages to, as you say, letting the "domain admin ... balance the mailbox quota for different users, but not exceed the domain quota."

Unless, I wonder if the global admin can override the "Max quota of mail user" for a domain to create (in this example) one 5 GB user, while still leaving the "Max quota of mail user" set to 2 GB. (Tried that; it won't work.) Or increase it temporarily, create the 5 GB User, and then set it back again. (That *does* seem to work, as iRedAdmin still shows that the quota for the 5 GB account is still 5 GB when I lower the "Max quota of mail user" to 2 GB.) What do you think?

ZhangHuangbin wrote:

Sure. Login to iRedAdmin-Pro as global admin, go to domain profile page.

Thanks, I see that, but that only does it for one domain. I worded my question wrong; I suppose I'm looking for a way to set the default quota for all new users globally. Or if I want to do it for all existing domains do I just change the value of the vmail.domain.settings column? Then I can set it for each domain in the future as I create it in iRedAdmin.

And would I edit vmail.mailbox.quota to change the quota for existing users? I'm just looking for a way to do this quickly for all users rather than doing it through the web interface.

ZhangHuangbin wrote:

It's easy, create a new config file under /etc/nginx/sites-available/ for your web domain "example.com" like this:

Thanks. I will work on that next.

ZhangHuangbin wrote:

Depends on how you upgrade Roundcube.

OK, well, the current version of Roundcube is installed already on the new server, of course. So I was looking at those SQL files in "SQL/mysql/<xxx>.sql", but I was hoping the current version would recognise the old database and import those automatically. However, if not, I will do it manually if that's the right way to do it.

Thanks again.


Craig

4

Re: Migration questions

Can I assume that I do not need to import the old "amavisd" database to the new server? It just looks like stuff that is related to the processing and tracking of mail on the old server, and on the new server it will be repopulated automatically with data related to the new server.

5

Re: Migration questions

Another question. I'll keep them under this thread.

The "new" (to me) filtering of domains by the first letter is great. Thanks. However, when I'm displaying all domains, what is the sort order? I have multiple pages of domain, but just the first page lists domains running from A to Z, when there are many domains in between and Z domains shouldn't appear until the last page.

Clicking on the "Domain" header changes the sort order for just that page, but even then the order still doesn't make sense. It seems that domains with aliases get sorted at the top, then domains starting with A. And those Z domains are still on the page.

Have I done something wrong?


Craig

6

Re: Migration questions

OK, so I imported the various databases from my old server to the new server, but the initial domain set up during the installation of iRedMail (and iRedAdmin-Pro) on the new server is, of course, missing, because it did not exist on the old server. The mail spool for the domain exists in the file system, of course.

I presume this can be fixed by simply importing certain records from the original databases. I have a back-up copy of the "vmail" database, which seems to be the only database with relevant data; should I just import the records in that?

Thanks.


Craig

7

Re: Migration questions

craig wrote:

Can I assume that I do not need to import the old "amavisd" database to the new server? It just looks like stuff that is related to the processing and tracking of mail on the old server, and on the new server it will be repopulated automatically with data related to the new server.

According to the information at https://docs.iredmail.org/migrate.to.ne … erver.html the "amavisd" database is only important if there is data in the mailaddr, policy, users and wblist tables. Since I don't think Amavisd was ever really properly working on my old server these are empty, so I seem to be on the right track here.

8

Re: Migration questions

craig wrote:

OK, so I imported the various databases from my old server to the new server, but the initial domain set up during the installation of iRedMail (and iRedAdmin-Pro) on the new server is, of course, missing, because it did not exist on the old server. The mail spool for the domain exists in the file system, of course.

An unfortunate side effect of this is that I cannot view the email with all of the information about the new iRedMail installation. I was looking all over for it (as I hadn't saved it somewhere else separately yet) then realised where it is. It's still on the server, just inaccessible in the normal way until I figure out how to put the domain back into or reattach it to the iRedAdmin system.