Right now to recover from a backup with an encrypted HD wallet the user must do something like unlock the wallet with a really long time out and manually trigger a rescan,  otherwise they risk missing some keys when auto-topup cannot run.
void CWalletSetupLegacyScriptPubKeyMan()
{
    if (!m_internal_spk_managers.empty() || !m_external_spk_managers.empty() || !m_spk_managers.empty() || IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
        return;
    }
    auto spk_manager = stdunique_ptr<ScriptPubKeyMan>(new LegacyScriptPubKeyMan(*this, m_keypool_size));
    for (const auto& type  LEGACY_OUTPUT_TYPES) {
        m_internal_spk_managers[type] = spk_manager.get();
        m_external_spk_managers[type] = spk_manager.get();
    }
    m_spk_managers[spk_manager->GetID()] = stdmove(spk_manager);
}
const CKeyingMaterial& CWalletGetEncryptionKey() const
{
    return vMasterKey;
}
bool CWalletHasEncryptionKeys() const
{
    return !mapMasterKeys.empty();
}
void CWalletConnectScriptPubKeyManNotifiers()
{
    for (const auto& spk_man  GetActiveScriptPubKeyMans()) {
        spk_man->NotifyWatchonlyChanged.connect(NotifyWatchonlyChanged);
        spk_man->NotifyCanGetAddressesChanged.connect(NotifyCanGetAddressesChanged);
    }
}
void CWalletLoadDescriptorScriptPubKeyMan(uint256 id, WalletDescriptor& desc)
{
    if (IsWalletFlagSet(WALLET_FLAG_EXTERNAL_SIGNER)) {