This can be done with email client software since Gmail supports the IMAP protocol.
I use Outlook and Thunderbird, but should work with other desktop email software
Enable IMAP in your Gmail account: Navigate to Settings -> Forwarding and POP/IMAP. Under IMAP access ensure that “Enable IMAP” is checked. Click Save Changes.
Navigate to Settings -> Labels. Make sure that every system label you want to backup has a check mark for “Show in IMAP”. By default “Chats” is not checked, so make sure you check it. The only labels you should uncheck during this process are the Spam and Trash labels.
Export sub account Filters Navigate to Settings -> Filters. Each filter you’ve created has a distinct entry with a checkbox beside it. Check each filter you wish to backup and then click the Export button at the bottom. Your will be prompted to download “mailFilters.xml”. Save this file for later.
You can use our IMAP-enabled email client to transfer all our emails and chat logs between accounts.
Setup the Gmail account in your client software, based on google support instructions https://support.google.com/mail/answer/7126229
Using Thunderbird in this example
After installing Thunderbird, run it. Follow the instructions in the setup wizard, plugging in your sub Gmail account and password. If it doesn’t automatically pull your email account, click the Get Mail button in the upper left hand corner to confirm Thunderbird can connect.
Review the folders in Thunderbird make sure they are the Gmail labels
Once you’ve plugged in the login information for your sub Gmail account and confirmed you can connect to it, you can then add the main Gmail account
Click on the Menu icon in the upper right hand corner and navigate to Options -> Account Settings.
At the bottom of the menu pane there is a drop down menu labeled Account Actions. Click on it and select Add Mail Account. Add the login information of your main Gmail account. In the main Thunderbird navigation panel, you should see both your old Gmail account and your new Gmail account listed.
Installing Copy Folder: You can manually copy your email and chat files between folders but usually no verification system.
Or use a Thunderbird add-on called Copy Folder. Click on the menu button in the upper right hand corner and select Add-ons. In the search box type in “Copy Folder”. This specific add-on is Copy Folder by jwolkinsky. Click Add to Thunderbird and return to the main Thunderbird interface.
In Thunderbird, right click on the top listing for your old Gmail account
Once you’ve installed the add-on, navigate to Options -> Account Settings. Within the settings for your old Gmail account, ensure that under Synchronization and Storage “Keep message for this account on this computer” is checked..
You can do an IMAP account to IMAP account transfer but by copying it to your local machine first you cut down on the risk of errors and you’ll have a local backup of your entire old account.
Copying Labels Folders to Your Local Machine copy the contents of our old account to our local machine.
NOTE: The root directory for the local machine is Local Folders and the root directory for your new Gmail account is the gmail address, the folder structure needs to match up perfectly when you copy it. Copy Folder always gives you a confirmation when you select your folders. Check the confirmation each time you copy to make sure directories match (e.g. Local Folders > Inbox to Gmail > Inbox).
Repeat this process for all the Local Folders you wish to copy to your new Gmail account.
Importing Your Filters When the process is finished, log into your new Gmail account. Navigate to Settings > Filters. Click on Import Filters at the bottom of the screen and select the MailFilters.xml you saved during the filter export process on your old Gmail account.