[#wallet-MigrateLegacyToDescriptor-08]
= xref:wallet.adoc[wallet]::MigrateLegacyToDescriptor
:relfileprefix: ../
:mrdocs:

`MigrateLegacyToDescriptor` overloads

== Synopses

Declared in `&lt;wallet&sol;wallet&period;h&gt;`

Requirement&colon; The wallet provided to this function must be isolated, with no attachment to the node&apos;s context&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
xref:util/Result.adoc[util::Result&lt;MigrationResult&gt;]
xref:wallet/MigrateLegacyToDescriptor-09.adoc[MigrateLegacyToDescriptor](
    std::shared&lowbar;ptr&lt;CWallet&gt; local&lowbar;wallet,
    xref:SecureString.adoc[SecureString] const& passphrase,
    xref:wallet/WalletContext.adoc[WalletContext]& context,
    bool load&lowbar;wallet = true);
----

[.small]#xref:wallet/MigrateLegacyToDescriptor-09.adoc[_» more&period;&period;&period;_]#

Do all steps to migrate a legacy wallet to a descriptor wallet


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
xref:util/Result.adoc[util::Result&lt;MigrationResult&gt;]
xref:wallet/MigrateLegacyToDescriptor-06.adoc[MigrateLegacyToDescriptor](
    std::string const& wallet&lowbar;name,
    xref:SecureString.adoc[SecureString] const& passphrase,
    xref:wallet/WalletContext.adoc[WalletContext]& context,
    bool load&lowbar;wallet = true);
----

[.small]#xref:wallet/MigrateLegacyToDescriptor-06.adoc[_» more&period;&period;&period;_]#

== Return Value

The migration result, or an error on failure&period;

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *local&lowbar;wallet*
| The isolated wallet to migrate&period;
| *passphrase*
| The passphrase to unlock an encrypted wallet&period;
| *context*
| The wallet context to migrate within&period;
| *load&lowbar;wallet*
| Whether to load the migrated wallet afterward&period;
| *wallet&lowbar;name*
| The name of the wallet to migrate&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
