First off, make one or two full backups of the old iMac before you begin. Just in case something goes wrong.
If you want to migrate via the network, use Ethernet if you can. It is faster and more reliable than Wi-Fi.
If you can’t migrate via the network (as was the case when I upgraded my Mac last year - the source machine can’t enter migration mode if it is running the Server app), then you will have to migrate via its hard drive. There are three ways to do this:
Migrate from a Time Machine backup of the source machine. You should be able to pick the specific backup (date/time) to migrate from, just in case you don’t want to use the latest backup.
Migrate from a clone of the source system’s hard drive.
This is what I used for my migration. I connected the backup drive over FireWire (using several adapter dongles), since that performs better than USB 2.0, and did the migration over that connection.
Migrate from the source system’s hard drive itself by putting it into Target Disk mode. This will, of course, require a compatible connection between the two. If your iMac’s Target Disk mode runs over FireWire (as I think all Macs from that era do), then you’ll need some adapter dongles to connect it to your new Mac.
Or, given the age, maybe you don’t want to migrate at all. Since a lot (maybe most) of your apps aren’t going to be compatible with the new Mac (nothing 32-bit works on macOS 10.15 and later), it might be better to just create login accounts on the new Mac, use normal file sharing to copy all your documents from the old Mac to the new one, and then manually install your apps. This will probably take longer, but you might find it easier, especially if the migration doesn’t go smoothly.