Quick question here. If I run listdescriptor and then importdescriptor with an exported file on a new system, will I still have access to the same wallets and funds? I mean, does listdescriptor true and importdescriptor do the same job as dumpprivkey and importprivkey?
So if my exported file has the private key, I can import it to a new machine and recover my wallet and funds? But what if it only has the public key? I can see the addresses but can’t spend anything, right?
Exactly! If you set "true" for the private key argument in listdescriptor, then private keys get exported too. After importing those, you can spend the funds. Achow101 basically answered your question perfectly. In newer wallets, listdescriptor true and importdescriptor replace the older dumpprivkey and importprivkey commands.
Also, check this link for importing xpriv according to its address type: How to import an xpriv to a descriptor wallet in bitcoin core? If you want to bring in individual private keys, just follow the same logic. I even made a thread about importing privkeys into a Bitcoin Core descriptor wallet.