[#wallet-MigrateLegacyToDescriptor-06] = xref:wallet.adoc[wallet]::MigrateLegacyToDescriptor :relfileprefix: ../ :mrdocs: Do all steps to migrate a legacy wallet to a descriptor wallet == Synopsis Declared in `<wallet/wallet.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] xref:util/Result.adoc[util::Result<MigrationResult>] MigrateLegacyToDescriptor( std::string const& wallet_name, xref:SecureString.adoc[SecureString] const& passphrase, xref:wallet/WalletContext.adoc[WalletContext]& context, bool load_wallet = true); ---- == Return Value The migration result, or an error on failure. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *wallet_name* | The name of the wallet to migrate. | *passphrase* | The passphrase to unlock an encrypted wallet. | *context* | The wallet context to migrate within. | *load_wallet* | Whether to load the migrated wallet afterward. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#