1

Topic: Migrating to new server

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

Trying to migrate mailboxes to a new server using rsync and get permission errors, is there an example of an rsync command that works?

root@sark:/var/vmail# sudo rsync -vr  /var/vmail/ xxxxx@192.168.0.150:/var/vmail/
xxxxx@192.168.0.150's password:
sending incremental file list
rsync: change_dir#1 "/var/vmail/" failed: Permission denied (13)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(631) [Receiver=3.1.1]

Adrian

----

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

2

Re: Migrating to new server

Sync mailbox with rsync + ssh like below:

rsync -avz \
    --exclude "dovecot.index*" \
    -e "ssh -p 22" \
    root@192.168.0.19:/var/vmail/vmail1/ /var/vmail/vmail1/

3

Re: Migrating to new server

Hi Zhang,

I saw this and I want to do the same thing - to copy all emails from old server to new server.

1. Can you please confirm that the below rsync command should be run on new iRedmial server?
2. Also does this rsync preserve the timestamp?

ZhangHuangbin wrote:

Sync mailbox with rsync + ssh like below:

rsync -avz \
    --exclude "dovecot.index*" \
    -e "ssh -p 22" \
    root@192.168.0.19:/var/vmail/vmail1/ /var/vmail/vmail1/

Mathew

4

Re: Migrating to new server

mathewfer wrote:

1. Can you please confirm that the below rsync command should be run on new iRedmial server?

It doesn't hurt to run it for testing. smile

mathewfer wrote:

2. Also does this rsync preserve the timestamp?

Yes, with the "-a" option. (If you check rsync manual page: "-a" is same as "-rlptgoD", and "-p" preserves permissions, "-t" preserves timestamp).