In addition to using an external hard drive, as léonie suggested, you could try using Target Mode to connect the two Macs together directly.
Transfer files between two Mac computers using target disk mode - Apple Support
Basically you connect the computers with a USB cable and set one to Target Mode so the other can read its internal drive. I tried it the other day and it was kinda fun to explore one computer's drive from the other.
Target Mode is different for Silicon Macs than for older intel Macs, and I haven't tried connecting two different kinds. It seems more likely that the new iMac could read the 2012 Mac's drive format rather than vice-versa, so I'd think that you'd want to switch the old one to target mode.
I think I have an older Mac around that I can try out. Let us know if you try this and how it goes…