imapsync is a popular tool for migrating from one IMAP server to another, including GMail and Google for Business. You can no longer download the source code directly from the author for free, however the unique ‘no limit’ license allows an unofficial fork to be available on GitHub. As of this writing the fork lags the original slightly, but it should not be an issue for most people.
Here is how to install it on Ubuntu.
sudo apt-get install makepasswd rcs perl-doc libmail-imapclient-perl
Clone the Git Repository
git clone git://github.com/imapsync/imapsync.git
Don’t forget to cd into the ‘imapsync’ directory once it is finished being cloned.
Create a Dist Directory
You need to make a `dist` directory. I suspect this is because Git does not track directories, only files:
Build and Install
sudo make install
Once this is done, you can run a script like the one below, which was inspired (and borrowed) from this blog post
- This post is where I found the original version of the script above.
- You might also find this page about migrating your email to Google Apps useful.
You will need two systems for this walkthrough. One will become the Puppetmaster, controlling the deployment of the other system, known as a Puppet Node. I am using Amazon AWS for these systems, but you can use any solution that offers Ubuntu systems.
We will start with the Puppetmaster…
sudo apt-get install puppetmaster
sudo apt-get install puppet
You will need to be logged into both the master and the node for this next step.
On the node, the following command will get the node to connect to the master, where it will wait 60 seconds for the master to sign its certificate. Timing is important, you need to complete the steps on both servers within the allotted time.
On the node, run the following command:
sudo puppet agent --server <puppetmaster hostname> --waitforcert 60 --test
On the master, run the following to show the list of certificate requests. You should see your node listed:
sudo puppet cert list
Now sign the request:
sudo puppet cert --sign <node hostname>
If you an experience a timeout during the certificate signing process or if you run into trouble with this process, try deleting the /var/lib/puppet/ssl directory on both systems, then restart the puppetmaster daemon with:
sudo /etc/init.d/puppetmaster restart
Start Puppet Automatically
When you install puppetmaster on Ubuntu, it is configured to run automatically on boot, but you need to configure the node to start on boot.
Edit /etc/default/puppet and change:
Then start puppet:
service puppet start
At this point you have a complete puppet configuration. The only thing you are missing is a puppet configuration to share from the master to the node.