I switched from AT&T to T-Mobile today, and all the voicemails I had on my iPhone 5S (iOS 11) were lost after my AT&T account was closed.
How can I recover them?
Luckily, this was possible (my important voicemails were not lost!) and you have three options, which I'll describe below. The first two will require a Mac (or maybe PC would work) and will cost you money (if you haven't already purchased the right app, or find an alternative that's reputable and free), while the third may be free.
If you recently backed up your iPhone to iTunes on a Mac (fairly recently, before switching carriers) then you can use an app like PhoneView ($30) or iExplorer ($40) to recover your voicemails from the old iTunes backup. PhoneView is free for up to the last 10 voicemails, but for more than that you'll need to buy it. With iExplorer, you'll need to buy it for any number of voicemail exports.
I contacted AT&T's chat support to ask them what to do before figuring out the methods above. Their representative told me to do the following:
To recover your VMs, you'll want to call the Global Legal Demand Center (GLDC), formerly known as the National Compliance Center (NCC). Their number is 800-635-6840.
Just ask them you need your VMs for legal purposes.
Kind of questionable, but maybe worth a shot!
Hope this helps, and leave a comment below if I can help more.