rsync and dovecot-uidlist, dovecot-uidvalidity files

Discussion in 'General' started by barbarab, Jul 17, 2025.

  1. barbarab

    barbarab Member

    Hello, I want to terminate a client to whom I had the brilliant idea of hosting email for free. Before moving them elsewhere, I want to copy the contents of their mailbox into a test mailbox inside a new domain also created on ISPConfig. Everything is inside the vmail folder. I’d like to do it with rsync, but I’m unsure what to do with files like dovecot-uidlist dovecot-keywords dovecot-uidvalidity, etc. — I’d rsync from /var/vmail/olddomain/user/Maildir/ to /var/vmail/newdomain/testuser/Maildir/ -- the testuser has already his empty mailbox (with a welcome message) -- should I exclude anything in the rsync command? thank you
    (ispconfig 3.2.4 ubuntu 20.04)
     
  2. pyte

    pyte Well-Known Member HowtoForge Supporter

    Create the new mailbox and just use imapsync for this. If you don't have any data in the new user you should be able to just rsync all files without any issue.
     
  3. barbarab

    barbarab Member

    thank you @pyte,
    since I simply want to sync two mailboxes locally on the same server and under the same vmail folder structure (just in a different domain and the destination Maildir has only the welcome message inside), I was considering a basic rsync, perhaps using --numeric-ids. But I’m worried about messing up UID files.
    I’ve read the documentation and now also see options like doveadm sync and doveadm backup.
    What do you recommend? Could I go with rsync (which files, if any, should I exclude?) or the Dovecot tools are safer?
     
  4. pyte

    pyte Well-Known Member HowtoForge Supporter

    When using doveadm you can use it like that:
    Code:
     doveadm import -u [email protected] maildir:/srv/vmail/domain.tld/local.account/Maildir "" all
    All methods should work just fine. MailDir is pretty robust so moving over the files with cp or rsync works. I've recently migrated from an old to a new mailserver. There where severals hunderts of MailDirs and just rsync'd them all to the new server. It worked without a single issue.
     
  5. barbarab

    barbarab Member

    Thank you @pyte. In the end, I skipped that (unnecessary) local step and found imapsync to be an excellent tool for migrating to another server.
     
    pyte likes this.

Share This Page