Alter location of user mailbox in Zimbra 8 MariaDB

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
avea2003
Posts: 13
Joined: Sat Sep 13, 2014 3:31 am

Alter location of user mailbox in Zimbra 8 MariaDB

Postby avea2003 » Wed Apr 22, 2015 7:24 am

What a change the some users mailbox location. Read  this


Solution2: Another method that can be used is updating the DB itself.

There's a volume_id column in the mail_item table in every mboxgroup database - after moving the blobs themselves you could run something like: mysql> for (N = 1 through 100) {UPDATE mboxgroupN.mail_item SET volume_id = IDofNew WHERE volume_id = IDofOld;}

The first N is talking about the mailbox group (id divided by 100) for which there's 100max groups. Account mailbox database structure - Zimbra :: Wiki

---

Of course using LVM to expand /opt/zimbra, /opt/zimbra/store, or /opt/zimbra/index is another easy route - if you've deployed LVM.

If you wanted to poke around, some basic structure:
su - zimbra
mysql
show databases;
use mboxgroupN
show tables;
select * from mail_item where volume_id=1; (would get you all the items in volume 1)
That's a BIG query btw! So probably better if you selected by mailbox_id or id - narrow this down and try stuff on a test account or individual msg - better yet a test harness machine before you run any update/set/alter commands across every account on your production system.

CLI zmvolume - Zimbra :: Wiki
zmvolume -l
zmvolume -dc
mysql> select * from zimbra.volume;

MySQL commands: Pantz.org Technical Reference Site)


But now in Zimbra 8.6 in mboxgroup table we not have volume_id


MariaDB [mboxgroup16]> describe mail_item;
+--------------+---------------------+------+-----+---------+-------+
| Field        | Type                | Null | Key | Default | Extra |
+--------------+---------------------+------+-----+---------+-------+
| mailbox_id   | int(10) unsigned    | NO   | PRI | NULL    |       |
| id           | int(10) unsigned    | NO   | PRI | NULL    |       |
| type         | tinyint(4)          | NO   |     | NULL    |       |
| parent_id    | int(10) unsigned    | YES  |     | NULL    |       |
| folder_id    | int(10) unsigned    | YES  |     | NULL    |       |
| prev_folders | text                | YES  |     | NULL    |       |
| index_id     | int(10) unsigned    | YES  |     | NULL    |       |
| imap_id      | int(10) unsigned    | YES  |     | NULL    |       |
| date         | int(10) unsigned    | NO   |     | NULL    |       |
| size         | bigint(20) unsigned | NO   |     | NULL    |       |
| locator      | varchar(1024)       | YES  |     | NULL    |       |
| blob_digest  | varchar(44)         | YES  |     | NULL    |       |
| unread       | int(10) unsigned    | YES  |     | NULL    |       |
| flags        | int(11)             | NO   |     | 0       |       |
| tags         | bigint(20)          | NO   |     | 0       |       |
| tag_names    | text                | YES  |     | NULL    |       |
| sender       | varchar(128)        | YES  |     | NULL    |       |
| recipients   | varchar(128)        | YES  |     | NULL    |       |
| subject      | text                | YES  |     | NULL    |       |
| name         | varchar(255)        | YES  |     | NULL    |       |
| metadata     | mediumtext          | YES  |     | NULL    |       |
| mod_metadata | int(10) unsigned    | NO   |     | NULL    |       |
| change_date  | int(10) unsigned    | YES  |     | NULL    |       |
| mod_content  | int(10) unsigned    | NO   |     | NULL    |       |
| uuid         | varchar(127)        | YES  |     | NULL    |       |
+--------------+---------------------+------+-----+---------+-------+
25 rows in set (0.00 sec)


How change location of user mailbox? not all



Return to “Administrators”

Who is online

Users browsing this forum: Bing [Bot] and 12 guests