Wireless is really slow.
An older Mac running Yosemite will either have Thunderbolt 1, or Firewire for connectivity.
Note, documents which belong to 32 bit applications which have not been upgraded to 64 bit equivalents you will need to maintain running on your older Mac, especially if the newer Mac is newer than last October's release of Catalina.
You can install an intermediate operating system on a separate partition that is older until all your applications are up to date based on the minimum operating system that came with the Mac.
If all the applications that run on your Catalina machine can open all the documents you need from Yosemite, use the Migration Assistant to bring over the data from Yosemite.
Migration Assistant is run by putting the Yosemite machine in Target Disk Mode (holding the T key at startup), and connecting it via Firewire or Thunderbolt (available on 2012 or later machines) to the newer Mac. Go to Apple menu -> About This Mac to determine the age of your Yosemite machine.
Mid-2011 and earlier Macs have a thunderbolt like port that is actually displayport, and does not transfer data.
https://www.apple.com/shop/product/MMEL2AM/A/thunderbolt-3-usb-c-to-thunderbolt-2-adapter - Transfers from Thunderbolt 2 to the newer USB-C found on some Macs. Note the power cable for laptops that use USB-C is not a data transfer cable!
https://www.apple.com/shop/product/MD464LL/A/apple-thunderbolt-to-firewire-adapter - transfers from Firewire 800 to Thunderbolt 2.
Link the machines with the appropriate cables and adapters after setting the target disk mode on the older machine, and then run the Migration Assistant in the Utilities folder of the Applications folder.
You can also use Ethernet if both machines have ethernet, and start the migration assistant on the older Mac first, and then the newer Mac. The two will be able to communicate to each other if both are using ethernet. Ethernet is at least ten times faster than WiFi.
Thunderbolt 3 is the data transfer standard for USB-C on Macs.
P.S. iMac is not an acronym and only the 2nd letter is capitalized.