My question regarding this was more about "if I just need to dumpwallet from console in Bitcoin Core, then do I really need Bitcoin core to start syncing?"
Yes,
dumpwallet will work even offline.
Can someone confirm how to import the whole wallet into Electrum instead of all the private keys one by one?
A workaround to that is only possible in the newer "
descriptor wallet" that has a compatible extended public/private key at account_index.
But your old legacy wallet.dat uses "
hardened addresses" which Electrum doesn't support.
For clarification, Even if your wallet is HD, you simply cannot derive the master private key to be imported to Electrum as master key because Electrum will derive addresses with unhardened derivation while your Bitcoin Core used hardened derivation to derive your private keys from it.
dumprivkey works with only one address at a time
dumpwallet should dump whole wallet. Then do I just copy paste all the private keys into Electrum to import all at once?
Which method is recommended?
Depends if you know which addresses are funded.
If you know which ones, and you can count them with your fingers (
and toes), then dumpprivkey is the way.
If not, dumpwallet, then extract the private keys from the wallet dump file,
e.g.: Google search for ways to extract the texts that you need from a text file, but you must only meddle with the dump file in an air-gap machine.