1

Topic: Backup and Restore Procedure

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.5.-1
- Linux/BSD distribution name and version: Debian 8.4.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====

Good morning,

I have read the backup and restore documentation, and the thread here - http://www.iredmail.org/forum/topic1064 … boxes.html

I am a little confused by exactly what I should back up and restore. My understanding is that backing up the MySQL databases with the backup scripts backs up the email accounts, but the emails themselves are held in a standard directory structure in the filesystem under /var/vmail/vmail1.

I am migrating from a server I set up some years ago and was my first attempt at running a Linux email server. I learned as I went along and think it is time to refresh the system and my knowledge. So I have an old server with a few domains which I want to separate out to new servers with one domain each. Each domain only has one email address that has useful emails.

I can see how the backup and restore of the MySQL database would be important for those with hundreds or more email accounts. But as I only have one, if I simply create a new email user on a new server with the same address as the old one and copy the relevant folder path from the old /var/vmail/vmail1/<domain>/u/s/e/r/ path, would this be enough to migrate successfully?

Thanks in advance.

----

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 Procedure

Hi, I am testing this also, and I used this thread als starting point.
http://www.iredmail.org/forum/topic577- … abase.html

your right you will need the old /var/vmail dir, and copy it to your new server.
TIP: if you restored your MYSQL, and vmail directory, and not seeing e-mail, but can login with your user account.
Chown on /var/vmail
I dont know the current user and group, but you can see it on your current installation.

3

Re: Backup and Restore Procedure

jsmith wrote:

as I only have one, if I simply create a new email user on a new server with the same address as the old one and copy the relevant folder path from the old /var/vmail/vmail1/<domain>/u/s/e/r/ path, would this be enough to migrate successfully?

Yes, it's enough.

4 (edited by jsmith 2016-05-17 23:44:19)

Re: Backup and Restore Procedure

Thanks both for the response.

I haven't restored MySQL, I have only recreated the same email user account. I then copied the directory

/var/vmail/vmail1/<domain>/u/s/e/r/..

but as I had already allowed Thunderbird to access the server with that account I ended up with two folders of

/var/vmail/vmail1/<domain>/u/s/e/r/<username><date><time>

I renamed the new one so only the restored directory began

/var/vmail/vmail1/<domain>/u/s/e/r/username..

(the other is /var/vmail/vmail1/<domain>/u/s/e/r/BACKUP-<username>

I now see the directory structure of my old emails but they are greyed out, and I see many subfolders for example ".INBOX.." on the file system belong to root. I have tried

"chown -R vmail:vmail /var/vmail/vmail1/<domain>/u/s/e/r/username.."

many times but it doesn't change the owner (I am logged in as a standard user then elevated with "su").

Am I doing something wrong? Do I need to stop a service? I tried the ones I thought it might be.

5

Re: Backup and Restore Procedure

Try:

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

6

Re: Backup and Restore Procedure

Thank you! That looks to have worked and emails are coming down to Thunderbird now.

As always excellent support here, thanks again.

7 (edited by jsmith 2016-05-18 05:53:02)

Re: Backup and Restore Procedure

I spoke too soon. I have followed my steps for a separate server with a second domain. Every time I try to add an account with Thunderbird it insists on creating a new directory instead of using the exiting one:

/var/vmail/vmail1/<domain>/u/s/e/r/<username><date><time>


I'm not sure what I did wrong, I checked the ownership on the correct folder is vmail:vmail. I have spent most of the day on this and must have forgotten one step, would anybody be able to help? Thank you.


EDIT: Nevermind, I did it the other way around by moving the restored directory contents to the one that gets created automatically.