1 (edited by Shibin Das 2014-01-16 14:21:34)

Topic: Backup and restore

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

Dear developer
i'm newby on learning mail server
have a serious problem about restoring my database. After I upgrade my RC and restore my database, I can't see the old messages on my INBOX, what should I do?

----

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

2

Re: Backup and restore

Is maildir path stored in SQL database (vmail.mailbox) same as the one on file system (/var/vmail/xxxx)?

3

Re: Backup and restore

mail directory is var/vmail/vmail1/xxxx.com. i am already restored this in to new server but I can't see the old messages on my INBOX.
What can i do to see the old messages on my inbox ?

4

Re: Backup and restore

*) Did you restore/copy mail messages (mailboxes) to this new server?
*) What's the maildir path stored in SQL database for this user?
*) What's the real path of this user's mailbox on file system?

5

Re: Backup and restore

yes i am restored all Databases and mailboxes in to the new server.The real path of user's mailbox is var/vmail/vmail1/xxx.com.

i want to backup and restore all users inbox,sent items and other folders in to a new server if any Hardware or other failure in my live server. please help

6

Re: Backup and restore

I'm afraid that i didn't make myself clear.

You can get user's maildir path stored in SQL database with below SQL commands:

$ mysql -uroot -p
mysql> USE vmail;
mysql> SELECT CONCAT(storagenode, '/', maildir, '/Maildir/') FROM mailbox;

It's a absolute path, please make sure you copied backup mailboxes to correct maildir path.

7

Re: Backup and restore

i am geting this error
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql> SELECT CONCAT(storagenode, '/', maildir, '/Maildir/') FROM mailbox' at line 1

The User's mailbox path stored in SQL database is /var/vmail/vmail1/xxx.com

i am  restored all Databases in SQL. all others like usrs,passwords and address books are restored but old mails not restored. so what can i do for restore users old mails in to a new server ? can you please explain.

8

Re: Backup and restore

Shibin Das wrote:

old mails not restored. so what can i do for restore users old mails in to a new server ? can you please explain.

Please copy whole directory /var/vmail/ on old server to new server directly.

9

Re: Backup and restore

ZhangHuangbin wrote:
Shibin Das wrote:

old mails not restored. so what can i do for restore users old mails in to a new server ? can you please explain.

Please copy whole directory /var/vmail/ on old server to new server directly.

10

Re: Backup and restore

Yes iam already copied whole directeries in var/vmail from old server in to new server.
But old mails are not in new server.

11

Re: Backup and restore

Shibin Das wrote:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql> SELECT CONCAT(storagenode, '/', maildir, '/Maildir/') FROM mailbox' at line 1

Please, when you copy command for executing, do not copy 'mysql>'. Try again please.

12

Re: Backup and restore

Thanks ZhangHuangbin for helping me
Iam restored mailboxes in new server but it will show only unreaded mails
Sent items is also empty.

13

Re: Backup and restore

*) How did you restore mailboxes? Show us detailed commands and output please.
*) Sent items are stored in folder '.Sent' under user mailbox.

14 (edited by Shibin Das 2014-01-22 18:05:13)

Re: Backup and restore

i am restored mailboxes in via ssh(secure shell client).just uploaded the  mailbox folder in directery /var/vmail.

please tell any other way to restore.

15

Re: Backup and restore

Could you please show us detailed commands and output?

User's mailbox is something like this: /var/vmail/vmail1/domain.com/u/s/e/username-20140122010101/Maildir/
So, did you restore mailbox to correct place?

16

Re: Backup and restore

Yes i am restored mail boxes in correct place.
But i am did not use any commands iam uploaded the backup mailbox in vmail directery remotly in through ssh.

17

Re: Backup and restore

Did you set correct file owner and permission recursively for folder /var/vmail/vmail1 after uploaded?
For example:

# chown -R vmail:vmail /var/vmail/vmail1
# chmod -R 0700 /var/vmail/vmail1

18

Re: Backup and restore

yes already set that file owner and permisions

19

Re: Backup and restore

Sorry, i have no idea yet.

Could you please show us this mail use's full maildir path on file system? User's maildir path is something like this: /var/vmail/vmail1/domain.com/u/s/e/username-20140122010101/Maildir/

And, please show me maildir path defined in SQL database:

$ mysql -uroot -p
mysql> USE vmail;
mysql> SELECT CONCAT(storagebasedirectory, '/', storagenode, '/', maildir, '/Maildir/') FROM mailbox WHERE username='EMAIL_ADDRESS_OF_YOUR_USER';

20

Re: Backup and restore

Thanks thanks a lot ZhangHuangbin . now i am successfully restored all my old mails.

actually the problem is my mailbox backup.now solved, thanks.