Archiving emails locally outside of Apple Mail/Server
You can add both Gmail accounts, wait for complete sync, and then

export each mailbox to your Desktop (or wherever you may want to on
your computer).
import the whole folder containing all the desired mailboxes to your Mail app.

You can then delete the synced accounts contents either on the Mail app or on the Gmail interface.
You'll end with a local backup of your accounts contents and two empty Gmail accounts synced to your Mail app.
You can skip step 2 if you DON'T want to have the contents of your old accounts available on your Mail app at the moment, and import them later on when you see fit. I'm afraid you won't be able to browse the contents of your backup (text or attachments) without first adding the whole mailbox to your Mail app.
You can also remove the old Gmail accounts from your Mail app if they start getting cluttered with spam (although you can teach Gmail what is spam by marking it as such on the Mail app interface or by dragging spam to the &quot;Junk&quot; folder.