1 (edited by dionysus 2011-12-16 00:15:17)

Topic: migrating from 0.6.x to 0.7.3

==== Provide basic information to help troubleshoot and get quick answer ====
- iRedMail version: 0.6.0 to 0.7.3
- Linux/BSD distribution name and version: centos 5.5 to 6.0
- Any related log? Log is helpful for troubleshooting.
====

I'm trying to upgrade to the latest iRedMail as noted above following this guide: http://www.iredmail.org/wiki/index.php? … ail.Server

Starting with a fresh Centos 6.0, I install iRedMail. I'm using mysql; I copied vmail over into the new server, exported vmail db from old server (tried both data only and full db) and copied to new server. Generated result.sql as instructed in the guide (to prevent dovecot deletion of emails).

If i overwrite the new vmail db with the old, the result.sql won't run as there are missing tables (bytes, etc) and the emails get deleted. If I try to import just the data into the vmail db, it won't import because there is a column count mismatch. (Note: this was done over 2 fresh iredmail installs; after the first didn't work I re-imaged the server and started over).

Is there a way to modify the 0.6 db so that I may import its data into the 0.7 db? I would rather not go through 8 upgrades to upgrade the 0.6 db through all the point releases to 0.7 before being able to impor the data into 0.7 db.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: migrating from 0.6.x to 0.7.3

There's a problem is iRedMail-0.7.3 and earlier versions which will cause some issues after migration, please refer to this section for more detail:

- Store realtime mailbox quota usage in seperate SQL table
  http://iredmail.org/wiki/index.php?titl … _SQL_table

It's fixed in the latest iRedMail-0.7.4 (not released yet).

dionysus wrote:

Is there a way to modify the 0.6 db so that I may import its data into the 0.7 db? I would rather not go through 8 upgrades to upgrade the 0.6 db through all the point releases to 0.7 before being able to impor the data into 0.7 db.

You have to compare SQL structures of 0.6 and the latest version to find out differences.

3

Re: migrating from 0.6.x to 0.7.3

Hi, thanks very much for the reply.

I did end up doing what you suggested--I compared the two db's and guessed at the missing values in the old db and find/replaced the queries to match up. This allowed me to run the query on mailbox table entering in all the users (I also ran the result.sql generated from the tutorial which set all the mailbox users bytes and messages fields to "-1"). However, the emails were still not showing up in the mailboxes. I started trying to get impasync to work, but couldn't. Then I came across something suggesting that both accounts be opened  in a mail client then dragging and dropping the emails to the new install--MUCH easier.

So, it seems to be working OK. Should I still set dovecot to use an alternative table to store mailbox.bytes and mailbox.messages? My mailbox table shows all users' bytes and messages as either 0 or the number they have.

Thanks again.

4

Re: migrating from 0.6.x to 0.7.3

dionysus wrote:

So, it seems to be working OK. Should I still set dovecot to use an alternative table to store mailbox.bytes and mailbox.messages? My mailbox table shows all users' bytes and messages as either 0 or the number they have.

It's STRONGLY recommended to create separate MySQL table to store mailbox.bytes and mailbox.messages, it will avoid similar issues which described in the wiki tutorial mentioned in my last reply.

My suggestion:

1) Create separate MySQL table to store realtime mailbox usage
2) Migrate users
3) Migrate mailboxes (in Maildir format)

Step 1) is important for migration.

5 (edited by dionysus 2011-12-18 08:46:02)

Re: migrating from 0.6.x to 0.7.3

I added in the table to mailbox, and it seems to be OK. It is calculating correctly.

However, during my journelys somewhere I must have messed up the maildir directly somehow... I brought in all of the users via the old db mysql (which I modified as described above). All of the users are there, and show in iredadmin etc. but when I try to connect to the server with a client via IMAP, all of the users are sharing the same vmail apparently.

dovecot.log

Dec 17 17:04:22 imap(user@domain.tld): Debug: Quota root: name=user backend=dict args=:proxy::quotadict
Dec 17 17:04:22 imap(user@domain.tld): Debug: Quota rule: root=user mailbox=* bytes=0 messages=0
Dec 17 17:04:22 imap(user@domain.tld): Debug: Quota warning: bytes=0 (85%) messages=0 reverse=no command=quota-warning 85 user@domain.tld
Dec 17 17:04:22 imap(user@domain.tld): Debug: Quota warning: bytes=0 (90%) messages=0 reverse=no command=quota-warning 90 user@domain.tld
Dec 17 17:04:22 imap(user@domain.tld): Debug: Quota warning: bytes=0 (95%) messages=0 reverse=no command=quota-warning 95 user@domain.tld
Dec 17 17:04:22 imap(user@domain.tld): Debug: dict quota: user=user@domain.tld, uri=proxy::quotadict, noenforcing=0
Dec 17 17:04:22 imap(user@domain.tld): Debug: maildir++: root=//var/vmail/-1/-1/Maildir, index=, control=, inbox=//var/vmail/-1/-1/Maildir, alt=
Dec 17 17:04:22 imap(user@domain.tld): Debug: Namespace : Using permissions from //var/vmail/-1/-1/Maildir: mode=0700 gid=-1

Which doesn't look right at all. *sigh* I guess it's time for round 3 of this install.

---

edit:

Something happened in the db during my modification/import, but I was able to get everything working. I had to go through and manually add the storagenode and maildir entries for each address in the mailbox table--I'm not sure what happened to them.