Mailing List Archive

Moving a queue to another server
Hi,

I am wondering if there is a good way to move all pending mails from
one exim server to another.
It is probably not the best idea to move the files from one spool
directory to another (idea 1).
I found this exim option in the man page and I guess it would be
possible to build a separate transport for transfering the queued
mails (idea 2):
exim -MC <transport> <hostname> <sequence number> <message id>
Another idea (3) would be to use the "fallback_hosts" option for each
transport and trigger an new delivery attempt for every mail in the
queue.
Idea 2 and 3 would reset the retry time and add another received
header, this would (probably) not be a problem.
I'd like to avoid canceling the delivery with -Mg.

Any advice on how to approach this mest?

Greetings,
Christian

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Moving a queue to another server [ In reply to ]
Christian K via Exim-users <exim-users@exim.org> (Do 12 Jul 2018 11:26:27 CEST):
> I am wondering if there is a good way to move all pending mails from
> one exim server to another.
> It is probably not the best idea to move the files from one spool
> directory to another (idea 1).


Why not? If you stop the Exim instance on the source host, you can just
transfer the files to the destination.

If the retry-times are important (they're not stored in the spool
*files*, but in separate files under the spool directory), just transfer
the content of the complete spool

rsync -a $(exim -n -bP spool_directory)/ REMOTE-HOST:REMOTE-SPOOL-DIR/

> exim -MC <transport> <hostname> <sequence number> <message id>
> Another idea (3) would be to use the "fallback_hosts" option for each
> transport and trigger an new delivery attempt for every mail in the
> queue.
> Idea 2 and 3 would reset the retry time and add another received
> header, this would (probably) not be a problem.
> I'd like to avoid canceling the delivery with -Mg.

For evaluation of the other ideas more information is necessary about
things like why, how-often, …

Best regards from Dresden/Germany
Viele Grüße aus Dresden
Heiko Schlittermann
--
SCHLITTERMANN.de ---------------------------- internet & unix support -
Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
gnupg encrypted messages are welcome --------------- key ID: F69376CE -
! key id 7CBF764A and 972EAC9F are revoked since 2015-01 ------------ -
Re: Moving a queue to another server [ In reply to ]
On 12 July 2018 12:03:03 CEST, Heiko Schlittermann via Exim-users <exim-users@exim.org> wrote:
>Christian K via Exim-users <exim-users@exim.org> (Do 12 Jul 2018
>11:26:27 CEST):
>> I am wondering if there is a good way to move all pending mails from
>> one exim server to another.
>> It is probably not the best idea to move the files from one spool
>> directory to another (idea 1).
>
>
>Why not? If you stop the Exim instance on the source host, you can just
>transfer the files to the destination.

Be careful to only do this to an equal or later Exim version.

>If the retry-times are important (they're not stored in the spool
>*files*, but in separate files under the spool directory), just
>transfer
>the content of the complete spool

Ditto, with respect to library versions also,
and more risky over library updates

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Moving a queue to another server [ In reply to ]
> I am wondering if there is a good way to move all pending mails from
> one exim server to another.
> It is probably not the best idea to move the files from one spool
> directory to another (idea 1).

For what it's worth, we've historically done exactly this for mail
server migrations (eg to a host with a newer OS release). We'll shut
down Exim on both hosts, then move over pretty much the entire mail
spool. I think the only problems we've sometimes had was needing to
reset the retry database(s). This does require a downtime on both
sides, though, and we've always been moving to a destination host where
the spool was empty (and in fact was disposable).

- cks

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Moving a queue to another server [ In reply to ]
Thanks for the feedback.

Rsyncing the spool sound like the most practical solution if it can be
done that easily.
Both servers are pretty much identical in configuration so there
should be no version differences of any kind (neither exim nor any
libraries).

I guess if this needed to be done more often and without any downtime,
I could imagine idea 2 being used though this won't be necessary for
my case since rsync is much simpler.

Am Do., 12. Juli 2018 um 21:41 Uhr schrieb Chris Siebenmann
<cks@cs.toronto.edu>:
>
> > I am wondering if there is a good way to move all pending mails from
> > one exim server to another.
> > It is probably not the best idea to move the files from one spool
> > directory to another (idea 1).
>
> For what it's worth, we've historically done exactly this for mail
> server migrations (eg to a host with a newer OS release). We'll shut
> down Exim on both hosts, then move over pretty much the entire mail
> spool. I think the only problems we've sometimes had was needing to
> reset the retry database(s). This does require a downtime on both
> sides, though, and we've always been moving to a destination host where
> the spool was empty (and in fact was disposable).
>
> - cks

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/