Mailchimp's export is a ZIP of three lists. Importing all of them is the mistake.
Since Bending Spoons agreed to buy Mailchimp on November 19, a lot of people have been clicking Export Audience to make a backup or try another tool. What they get is a ZIP. Inside are separate CSV files: one for subscr
Since Bending Spoons agreed to buy Mailchimp on November 19, a lot of people have been clicking Export Audience to make a backup or try another tool.
What they get is a ZIP. Inside are separate CSV files: one for subscribed contacts, one for unsubscribed, one for cleaned (Mailchimp's word for addresses that bounced), and one for non-subscribed.
Feed that ZIP, or all its files, into a generic CSV importer and every row becomes an active contact. Your first campaign from the new tool then goes to people who opted out and to addresses that bounce. That's a quick way to get a fresh sending domain flagged as spam.
We just shipped a Mailchimp import in Cresca that takes the ZIP as it comes. The rules are simple:
| File | What happens |
|---|---|
| subscribed | Imported as contacts, with tags and fields |
| unsubscribed | Added to the account's suppression list |
| cleaned | Added to the suppression list as a hard bounce |
| nonsubscribed / transactional | Skipped and reported |
Getting there took longer than the table suggests. Here are the five things that bit us.
1. "subscribed" is inside "unsubscribed"
We detect each file's type from its name. The obvious version is wrong:
if (name.includes('subscribed')) return 'subscribed'; // matches "unsubscribed" too
unsubscribed_…csv and nonsubscribed_…csv both contain "subscribed". Check the longer names first and match on the prefix:
for (const type of ['unsubscribed', 'nonsubscribed', 'cleaned', 'transactional', 'subscribed']) {
if (base.startsWith(type)) return type;
}
return null; // unknown file: reject with a clear message, never guess
If we can't tell what a file is, we reject the upload instead of treating it as subscribers. Guessing wrong here means emailing people who said no.
2. Our own test file broke the parser
We generated a test ZIP whose CSVs quote every field and start with a UTF-8 byte order mark (BOM). Both are common: many exporters quote every field, and Excel's "CSV UTF-8" format adds a BOM. The import failed with:
subscribed_….csv has no "Email Address" column.
The column was right there. The problem was the order of bytes: EF BB BF followed by "Email Address". Because the BOM sits before the opening quote, the CSV parser doesn't see a quoted field. It reads the quote characters as part of the header name, so the header became "Email Address" with the quotes in it. Stripping the BOM from the header string afterwards didn't help, because the quotes were still there.
The fix is to drop the BOM from the bytes before parsing:
const input =
buf.length >= 3 && buf[0] === 0xef && buf[1] === 0xbb && buf[2] === 0xbf
? buf.subarray(3)
: buf;
One line, plus a test for "BOM + quoted header". If you have a CSV import anywhere, it's worth checking yours for this.
3. Tags are a CSV inside a CSV
Mailchimp's TAGS column holds a quoted, comma-separated list in a single cell:
"Customer","VIP"
Once the CSV layer has unquoted the cell, you still have to split it without breaking tags that contain commas. We match the quoted parts first, then split whatever is left on commas, then trim and de-duplicate case-insensitively.
4. Order matters: suppress first, import second
An address can end up in both a suppression file and a subscribed file, for example when you import several audiences or a file someone edited by hand. So we process the unsubscribed and cleaned files before the subscribed one, and a subscribed row whose address is already suppressed is skipped and counted.
Two more rules sit underneath:
- A stronger reason is never replaced by a weaker one. If an address is already suppressed for a spam complaint, importing it as "unsubscribed" doesn't downgrade it.
- An unsubscribe only stops marketing email. Password resets and receipts sent through the API still reach that person. A hard bounce or complaint blocks everything.
Suppressions are written in batches of 1,000, so a list with tens of thousands of old unsubscribes doesn't take minutes.
5. Existing contacts weren't added to the new list
Our first upsert looked like this:
{ updateOne: { filter: { email, owner }, update: { $setOnInsert: doc }, upsert: true } }
That's right for new contacts and safe for existing ones, because it never overwrites a name. But it also meant that importing a second Mailchimp audience into a second list left every contact who was already in Cresca out of that list.
The fix keeps $setOnInsert for the contact's data and adds the list and tags with $addToSet:
update: {
$setOnInsert: doc,
$addToSet: { lists: { $each: listIds }, tags: { $each: tags } },
}
The import also never re-activates a contact who is unsubscribed, bounced or complained. Being in a "subscribed" file from another tool isn't consent.
What an export can't carry
No export moves automations, so write down each Mailchimp journey's trigger, emails and delays before you cancel. Campaign reports stay behind too, so download the ones you want to keep.
The part I don't know yet
We match Mailchimp files on their name prefixes (subscribed_, unsubscribed_, cleaned_). Mailchimp's help pages say the ZIP holds one CSV per contact status, but they don't document the file names, so they could change.
If you've exported from Mailchimp recently: do your file names start that way, and does your subscribed file start with a BOM? I'd like to know if there are variations we haven't seen.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.