how to backup files from an encrypted SD card for upgrade
The PIN/password is not the key used to encrypt/decrypt. The PIN/password is used to decrypt the key used to encrypt/decrypt (that's why one can change the PIN/password without re-encrypting the whole disk). Android does not provide a way to backup the encryption keys. 

So the easiest things to do is insert the old SD card to the phone, and via Wifi copy the files to the desktop PC. Then insert the new SD card, and copy the files from the desktop PC back to the phone.

For this you can use apps like AndFTP on the phone and FileZilla Server on Windows or openssh-server on Linux.