Recover Backup Image to Smaller SD Card

I’m just wondering if there is a relatively easy way to write a backup image onto an SD card that’s smaller than the original.

I’ve set up Ubuntu Mate for my RPi2 with everything I need installed and figured I’d make a backup image as I found I was having to start from scratch a lot while learning Ubuntu. As I was using a 64GB card, it made a 64GB image file despite the fact that there was a lot of free space on the card.

The problem now is that I’ve since re-purposed that SD card and the only cards I have are 32GB. I’d like to use the old image on the smaller cards as I’m certain I wasn’t using 32GB of space originally. I’ve googled some suggestions but unfortunately they all yield a card that gives a kernel panic when I boot up the Pi.

Any information is greatly appreciated. Thanks.

You don’t say what you are using for ‘backup’, or in what environment.
For linux look up ‘ddrescue’ which can avoid writing unused areas.
For Windows look up ‘USBIt’ which has similarly effective features.
I’ve used both
Derek

My apologies, I should have specified. I used Win32DiskImager to read from the SD card and make the img file.

I’ll give both of those a shot in the morning. Thank you for your help.