Be careful with imapsync if you end up using it on large folders, I have had it stall with over 3000 messages. There are commandline switches to limit the number of emails to process. I would keep the number to 500 or 1000 at a time. You can use the split1 and split2 commands, I have used it several times and it works flawlessly. Here is a sample...
imapsync --noauthmd5 --host1 <source.server> --port1 143 --split1 500 --user1 <username> --password1 <password> --sep2 / --prefix2 "" --host2 <destination.server> --port2 143 --split2 500 --user2 <username> --password2 <password>
NOTE: The above command is all on one line or break it up like this...
imapsync --noauthmd5 --host1 <source.server> --port1 143 --split1 500 --user1 <username> --password1 <password> \
--sep2 / --prefix2 "" --host2 <destination.server> --port2 143 --split2 500 --user2 <username> --password2 <password>