Problems archiving large mailbox

I have a gmail mailbox on apple mail, going back to 2005. I partially archived it in 2016, but had problems updating the archive. I therefore created new database just for the archive, and started archiving (used view import, chose database, dates, and then archive) It archived ~2400 of `20000 emails (most recent first) and then stopped. Log does not show anything.
Any suggestions?

I think perhaps you might take a look at this thread - it sounds pretty similar (but remains unresolved for that poster - but the thread does contain some suggestions)

If I’m not mistaken I think you can skip Mail all together and have Gmail create an mbox, download that and import it into DT.

If you are using the Pro or Server editions, then yes it’s possible to import a UNIX Mailbox, i.e., an .mbox file.

  1. I have the pro version

  2. I followed all the steps from the other thread. I archived
    However, two major issues.

  3. On my gmail account, I archive older emails. Those archives appear in my Mail sidebar. However, when I do View import, the menu of what is available (and I have several mailboxes from different accounts) does NOT include any of the archived mails. Therefore, my DT archive now contains all my sent mail, inbox, and some folders. Not the bulk of my mail

  4. On archiving, I got messages Couldn’t write message file. Can’t continue import of file.
    THis occurred (according to log) on 1135 messages. A few had complex attachments (eg, mp3 file), others pdfs, others just straight text, no attachments.
    Please help

BTW, when following instructions, on the automation window of prerefernces, DT3 has right to control finder, omnifocus, and Safari - not mail. Doesn’t seem to be way to add mail to that list. Should it be on there?