I have a bitcoin core full node with a wallet on VPS.
I use my own script to connect to the RPC. The script works on another VPS.
Sometimes bitcoin VPS goes offline. Once the recovery took a long time because the blockchain broke down. I'd like to avoid this situation in future. I've bought another VPS and installed second full node. If main node goes offiline, scriptwill check it and will connect to second node.
Now I'm finding a way for syncing wallets between nodes. I know, hot copying wallet.dat file is not allowed. I tried to use cron for dumpwallet on master and restorewallet on slave. But restorewallet took a lot of time. And I lost some newest addresses.
What is right way to build bitcoin core wallet replication?