Export Email From Gmail

Before you export your Gmail data - empty your trash and your spam folders try to delete as much email as you can (that you don't want).

Gmail will provide you with a single file with everything in it - which is probably more than you want and will be very slow and difficult to import.

Google has a wiki page on downloading your data. It directs you to login and then go to the download your data page.

On this page, you can choose which data to download and what format to save it in. If you are not sure about the format, choose a zip file.

It may take a while for Google to send you the link (like a day or more).

Once they do, unzip the link and you should have a folder called Mail and inside that folder is a file called "All mail Including Spam and Trash.mbox".

Splitting your mbox file

If this file is more than 16MB (and it probably is), then you will need to split it up into smaller chunks before you can import it.

You can download a multi-platform file splitter to do the trick. However, it won't be perfect - It can create a series of 15 MB files for you. But, it won't split the files at the right place. Each file should start with a line that has:


It will be followed by the name or address of the person sending the email (note - this is different from lines that start with From:).

So - you may need to manually adjust each file by adding the top portion of each file that preceeds the From line to the end of the previous file.

If you are on a unix-like machine, you can also try this command:

awk 'BEGIN{chunk=0} /^From /{msgs++;if(msgs==100){msgs=0;chunk++}}{print > "chunk_" chunk ".mbox"}' mbox

And lastly, if you find this tedious, please make a ticket and we can help you - please open a new ticket. We may ask you to copy your mbox file to your server and we can help you import it.

Once you have your 15 MB files ready, tou can use this file to import your email via roundcube.

Last modified 5 years ago Last modified on Aug 2, 2016, 3:50:58 PM