<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://simson.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Imap_migration</id>
	<title>Imap migration - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://simson.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Imap_migration"/>
	<link rel="alternate" type="text/html" href="https://simson.net/wiki/index.php?title=Imap_migration&amp;action=history"/>
	<updated>2026-08-05T18:22:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.4</generator>
	<entry>
		<id>https://simson.net/wiki/index.php?title=Imap_migration&amp;diff=464&amp;oldid=prev</id>
		<title>Simson: Created page with &#039;I found that the easiest way to move imap accounts from server to another is to use the &#039;&#039;&#039;imapsync&#039;&#039;&#039; program that can be installed using the MacPorts system. You can install it…&#039;</title>
		<link rel="alternate" type="text/html" href="https://simson.net/wiki/index.php?title=Imap_migration&amp;diff=464&amp;oldid=prev"/>
		<updated>2009-09-19T21:25:30Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;I found that the easiest way to move imap accounts from server to another is to use the &amp;#039;&amp;#039;&amp;#039;imapsync&amp;#039;&amp;#039;&amp;#039; program that can be installed using the MacPorts system. You can install it…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;I found that the easiest way to move imap accounts from server to another is to use the &amp;#039;&amp;#039;&amp;#039;imapsync&amp;#039;&amp;#039;&amp;#039; program that can be installed using the MacPorts system. You can install it with this command:&lt;br /&gt;
  sudo port install imapsync &lt;br /&gt;
  sudo port install p5-digest-hmac&lt;br /&gt;
&lt;br /&gt;
Here is an example of the parameters of the program:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ imapsync&lt;br /&gt;
&lt;br /&gt;
usage: /opt/local/bin/imapsync [options]&lt;br /&gt;
&lt;br /&gt;
Several options are mandatory. &lt;br /&gt;
&lt;br /&gt;
--host1       &amp;lt;string&amp;gt; : &amp;quot;from&amp;quot; imap server. Mandatory.&lt;br /&gt;
--port1       &amp;lt;int&amp;gt;    : port to connect on host1. Default is 143.&lt;br /&gt;
--user1       &amp;lt;string&amp;gt; : user to login on host1. Mandatory.&lt;br /&gt;
--authuser1   &amp;lt;string&amp;gt; : user to auth with on host1 (admin user). &lt;br /&gt;
                         Avoid using --authmech1 SOMETHING with --authuser1.&lt;br /&gt;
--password1   &amp;lt;string&amp;gt; : password for the user1. Dangerous, use --passfile1&lt;br /&gt;
--passfile1   &amp;lt;string&amp;gt; : password file for the user1. Contains the password.&lt;br /&gt;
--host2       &amp;lt;string&amp;gt; : &amp;quot;destination&amp;quot; imap server. Mandatory.&lt;br /&gt;
--port2       &amp;lt;int&amp;gt;    : port to connect on host2. Default is 143.&lt;br /&gt;
--user2       &amp;lt;string&amp;gt; : user to login on host2. Mandatory.&lt;br /&gt;
--authuser2   &amp;lt;string&amp;gt; : user to auth with on host2 (admin user).&lt;br /&gt;
--password2   &amp;lt;string&amp;gt; : password for the user2. Dangerous, use --passfile2&lt;br /&gt;
--passfile2   &amp;lt;string&amp;gt; : password file for the user2. Contains the password.&lt;br /&gt;
--noauthmd5            : don&amp;#039;t use MD5 authentification.&lt;br /&gt;
--authmech1   &amp;lt;string&amp;gt; : auth mechanism to use with host1:&lt;br /&gt;
                         PLAIN, LOGIN, CRAM-MD5 etc. Use UPPERCASE.&lt;br /&gt;
--authmech2   &amp;lt;string&amp;gt; : auth mechanism to use with host2. See --authmech1&lt;br /&gt;
--ssl1                 : use an SSL connection on host1.&lt;br /&gt;
--ssl2                 : use an SSL connection on host2.&lt;br /&gt;
--folder      &amp;lt;string&amp;gt; : sync this folder.&lt;br /&gt;
--folder      &amp;lt;string&amp;gt; : and this one, etc.&lt;br /&gt;
--folderrec   &amp;lt;string&amp;gt; : sync this folder recursively.&lt;br /&gt;
--folderrec   &amp;lt;string&amp;gt; : and this one, etc.&lt;br /&gt;
--include     &amp;lt;regex&amp;gt;  : sync folders matching this regular expression&lt;br /&gt;
--include     &amp;lt;regex&amp;gt;  : or this one, etc.&lt;br /&gt;
                         in case both --include --exclude options are&lt;br /&gt;
                         use, include is done before.&lt;br /&gt;
--exclude     &amp;lt;regex&amp;gt;  : skips folders matching this regular expression&lt;br /&gt;
                         Several folders to avoid:&lt;br /&gt;
			  --exclude &amp;#039;fold1|fold2|f3&amp;#039; skips fold1, fold2 and f3.&lt;br /&gt;
--exclude     &amp;lt;regex&amp;gt;  : or this one, etc.&lt;br /&gt;
--prefix1     &amp;lt;string&amp;gt; : remove prefix to all destination folders &lt;br /&gt;
                         (usually INBOX. for cyrus imap servers)&lt;br /&gt;
                         you can use --prefix1 if your source imap server &lt;br /&gt;
                         does not have NAMESPACE capability.&lt;br /&gt;
--prefix2     &amp;lt;string&amp;gt; : add prefix to all destination folders &lt;br /&gt;
                         (usually INBOX. for cyrus imap servers)&lt;br /&gt;
                         use --prefix2 if your target imap server does not&lt;br /&gt;
                         have NAMESPACE capability.&lt;br /&gt;
--regextrans2 &amp;lt;regex&amp;gt;  : Apply the whole regex to each destination folders.&lt;br /&gt;
--regextrans2 &amp;lt;regex&amp;gt;  : and this one. etc.&lt;br /&gt;
                         When you play with the --regextrans2 option, first&lt;br /&gt;
                         add also the safe options --dry --justfolders&lt;br /&gt;
                         Then, when happy, remove --dry, remove --justfolders&lt;br /&gt;
--regexmess   &amp;lt;regex&amp;gt;  : Apply the whole regex to each message before transfer.&lt;br /&gt;
                         Example: &amp;#039;s/\000/ /g&amp;#039; # to replace null by space.&lt;br /&gt;
--regexmess   &amp;lt;regex&amp;gt;  : and this one.&lt;br /&gt;
--regexmess   &amp;lt;regex&amp;gt;  : and this one, etc.&lt;br /&gt;
--regexflag   &amp;lt;regex&amp;gt;  : Apply the whole regex to each flags list.&lt;br /&gt;
                         Example: &amp;#039;s/&amp;quot;Junk&amp;quot;//g&amp;#039; # to remove &amp;quot;Junk&amp;quot; flag.&lt;br /&gt;
--regexflag   &amp;lt;regex&amp;gt;  : and this one, etc.&lt;br /&gt;
--sep1        &amp;lt;string&amp;gt; : separator in case namespace is not supported.&lt;br /&gt;
--sep2        &amp;lt;string&amp;gt; : idem.&lt;br /&gt;
--delete               : delete messages on source imap server after&lt;br /&gt;
                         a successful transfer. Useful in case you&lt;br /&gt;
                         want to migrate from one server to another one.&lt;br /&gt;
			 With imap, delete tags messages as deleted, they&lt;br /&gt;
			 are not really deleted. See expunge.&lt;br /&gt;
--delete2              : delete messages on the destination imap server that&lt;br /&gt;
                         are not on the source server.&lt;br /&gt;
--expunge              : expunge messages on source account.&lt;br /&gt;
                         expunge really deletes messages marked deleted.&lt;br /&gt;
                         expunge is made at the beginning on the &lt;br /&gt;
                         source server only. newly transferred messages&lt;br /&gt;
                         are expunged if option --expunge is given.&lt;br /&gt;
                         no expunge is done on destination account but&lt;br /&gt;
                         it will change in future releases.&lt;br /&gt;
--expunge1             : expunge messages on source account.&lt;br /&gt;
--expunge2             : expunge messages on target account.&lt;br /&gt;
--uidexpunge2          : uidexpunge messages on the destination imap server&lt;br /&gt;
                         that are not on the source server, requires --delete2&lt;br /&gt;
--syncinternaldates    : sets the internal dates on host2 same as host1.&lt;br /&gt;
                         Turned on by default.&lt;br /&gt;
--idatefromheader      : sets the internal dates on host2 same as the &lt;br /&gt;
                         &amp;quot;Date:&amp;quot; headers. &lt;br /&gt;
--buffersize  &amp;lt;int&amp;gt;    : sets the size of a block of I/O.&lt;br /&gt;
--maxsize     &amp;lt;int&amp;gt;    : skip messages larger than &amp;lt;int&amp;gt; bytes&lt;br /&gt;
--maxage      &amp;lt;int&amp;gt;    : skip messages older than &amp;lt;int&amp;gt; days.&lt;br /&gt;
                         final stats (skipped) don&amp;#039;t count older messages&lt;br /&gt;
			 see also --minage&lt;br /&gt;
--minage      &amp;lt;int&amp;gt;    : skip messages newer than &amp;lt;int&amp;gt; days.&lt;br /&gt;
                         final stats (skipped) don&amp;#039;t count newer messages&lt;br /&gt;
                         You can do (+ are the messages selected):&lt;br /&gt;
                         past|----maxage+++++++++++++++&amp;gt;now&lt;br /&gt;
                         past|+++++++++++++++minage----&amp;gt;now&lt;br /&gt;
                         past|----maxage+++++minage----&amp;gt;now (intersection)&lt;br /&gt;
                         past|++++minage-----maxage++++&amp;gt;now (union)&lt;br /&gt;
--skipheader  &amp;lt;regex&amp;gt;  : Don&amp;#039;t take into account header keyword &lt;br /&gt;
                         matching &amp;lt;string&amp;gt; ex: --skipheader &amp;#039;X.*&amp;#039;&lt;br /&gt;
--useheader   &amp;lt;string&amp;gt; : Use this header to compare messages on both sides.&lt;br /&gt;
                         Ex: Message-ID or Subject or Date.&lt;br /&gt;
--useheader   &amp;lt;string&amp;gt;   and this one, etc.&lt;br /&gt;
--skipsize             : Don&amp;#039;t take message size into account.&lt;br /&gt;
--allowsizemismatch    : allow RFC822.SIZE != fetched msg size&lt;br /&gt;
                         consider --skipsize to avoid duplicate messages&lt;br /&gt;
                         when running syncs more than one time per mailbox&lt;br /&gt;
--dry                  : do nothing, just print what would be done.&lt;br /&gt;
--subscribed           : transfers subscribed folders.&lt;br /&gt;
--subscribe            : subscribe to the folders transferred on the &lt;br /&gt;
                         &amp;quot;destination&amp;quot; server that are subscribed&lt;br /&gt;
                         on the &amp;quot;source&amp;quot; server.&lt;br /&gt;
--nofoldersizes        : Do not calculate the size of each folder in bytes&lt;br /&gt;
                         and message counts. Default is to calculate them.&lt;br /&gt;
--justfoldersizes      : exit after printed the folder sizes.&lt;br /&gt;
--syncacls             : Synchronises acls (Access Control Lists).&lt;br /&gt;
--nosyncacls           : Does not synchronise acls. This is the default.&lt;br /&gt;
--debug                : debug mode.&lt;br /&gt;
--debugimap            : imap debug mode.&lt;br /&gt;
--version              : print software version.&lt;br /&gt;
--justconnect          : just connect to both servers and print useful&lt;br /&gt;
                         information. Need only --host1 and --host2 options.&lt;br /&gt;
--justlogin            : just login to both servers with users credentials &lt;br /&gt;
                         and exit.&lt;br /&gt;
--justfolders          : just do things about folders (ignore messages).&lt;br /&gt;
--fast                 : be faster (just does not sync flags).&lt;br /&gt;
--reconnectretry1 &amp;lt;int&amp;gt;: reconnect if connection is lost up to &amp;lt;int&amp;gt; times&lt;br /&gt;
--reconnectretry2 &amp;lt;int&amp;gt;: reconnect if connection is lost up to &amp;lt;int&amp;gt; times&lt;br /&gt;
--split1     &amp;lt;int&amp;gt;     : split the requests in several parts on source server.&lt;br /&gt;
                         &amp;lt;int&amp;gt; is the number of messages handled per request.&lt;br /&gt;
                         default is like --split1 1000&lt;br /&gt;
--split2     &amp;lt;int&amp;gt;     : same thing on the &amp;quot;destination&amp;quot; server.&lt;br /&gt;
--fastio1              : use fastio with the &amp;quot;from&amp;quot; server.&lt;br /&gt;
--fastio2              : use fastio with the &amp;quot;destination&amp;quot; server.&lt;br /&gt;
--timeout     &amp;lt;int&amp;gt;    : imap connect timeout.&lt;br /&gt;
--help                 : print this.&lt;br /&gt;
&lt;br /&gt;
Example: to synchronise imap account &amp;quot;foo&amp;quot; on &amp;quot;imap.truc.org&amp;quot;&lt;br /&gt;
                    to  imap account &amp;quot;bar&amp;quot; on &amp;quot;imap.trac.org&amp;quot;&lt;br /&gt;
                    with foo password stored in /etc/secret1&lt;br /&gt;
                    and  bar password stored in /etc/secret2&lt;br /&gt;
&lt;br /&gt;
/opt/local/bin/imapsync \&lt;br /&gt;
   --host1 imap.truc.org --user1 foo --passfile1 /etc/secret1 \&lt;br /&gt;
   --host2 imap.trac.org --user2 bar --passfile2 /etc/secret2&lt;br /&gt;
&lt;br /&gt;
Here is a [darwin] system (Darwin imac2.local 10.0.0 Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I386 i386)&lt;br /&gt;
with perl 5.8.9&lt;br /&gt;
Mail::IMAPClient  3.19&lt;br /&gt;
IO::Socket        1.30&lt;br /&gt;
IO::Socket::SSL   &lt;br /&gt;
Digest::MD5       2.39&lt;br /&gt;
Digest::HMAC_MD5  &lt;br /&gt;
Term::ReadKey     &lt;br /&gt;
Date::Manip       &lt;br /&gt;
&lt;br /&gt;
$Id: imapsync,v 1.286 2009/07/24 15:53:04 gilles Exp gilles $ &lt;br /&gt;
&lt;br /&gt;
Happy with this free, open and gratis GPL software?&lt;br /&gt;
Please, thank the author (Gilles LAMIRAL) by giving him a book:&lt;br /&gt;
http://www.amazon.com/gp/registry/wishlist/1C9UNDIH3P7R7/&lt;br /&gt;
or rate imapsync at http://freshmeat.net/projects/imapsync/&lt;br /&gt;
&lt;br /&gt;
simsong@imac2:~$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Simson</name></author>
	</entry>
</feed>