Migrate mail_location

Aki Tuomi aki.tuomi at open-xchange.com
Tue Jan 11 06:13:53 UTC 2022


> On 11/01/2022 08:10 hello at reox.at wrote:
> 
>  
> On 05.01.2022 09:34, Aki Tuomi wrote:
> > 
> >> On 03/01/2022 10:51 hello at reox.at wrote:
> >>
> >>   
> >> Hi!
> >>
> >> I have a dovecot installation, with the following configuration:
> >> mail_home = /var/vmail/%d/%n
> >> mail_location = maildir:~
> >>
> >> I would like to migrate the mail_location to maildir:~/mail, to get
> >> around the issues described in the documentation.
> >> But I can not really find a good way to do that.
> >> I played around with doveadm sync/backup, but I can only copy everything
> >> into a new location (i.e. doveadm sync maildir:~/mail), but this does
> >> not really untangle the mail_home and location.
> >> My other idea was to migrate the maildir manually, i.e. move the maildir
> >> related folders and files (new, cur, tmp, all folders starting with a
> >> dot and containing itself {new,cur,tmp}, dovecot.* files, subscriptions
> >> file) into the ~/mail folder, but I'm not sure if this is a safe method.
> >>
> >> Is there any safe method to do this using dovecot tools? If the only way
> >> is a offline migration, I'm fine with that.
> >>
> >> Best,
> >> Sebastian
> > 
> > Hi!
> > 
> > Since you're using maildir, you can just stop dovecot, move the files, and start dovecot.
> > 
> > In particular, you should **not** move .dovecot.sieve directory, or dovecot-attributes (if you have used mail_attribute_dict).
> > 
> > It's a good idea to do testing.
> > 
> > Aki
> 
> Hi!
> Thanks for the answer! Just to confirm: that means the only files which 
> will stay in mail_home are all sieve related files and folders, 
> dovecot-attributes (I do not use this currently though) and the 
> xapian-indexes folder (I use fts-xapian)? Thus the files 
> dovecot{.index,.index.cache,.index.log,.index.thread,-keywords,.list.index,.mailbox.log,-uidlist,-uidvalidity,-uidvalidity.*} 
> all belong to the maildir?
> For most of them I'm pretty sure they belong to the maildir (if not 
> otherwise configured).
> Must I run some re-indexing command after migration, for example also 
> for the FTS?
> 
> I'll test that on a test server before but it is also good to know what 
> files belong where.
> 
> Sebastian

If you do the move correctly, there should be no need to reindex anything. I think the file list looks ok.

Aki


More information about the dovecot mailing list