[#wallet-CWallet-ApplyMigrationData]
= xref:wallet.adoc[wallet]::xref:wallet/CWallet.adoc[CWallet]::ApplyMigrationData
:relfileprefix: ../../
:mrdocs:

Adds the ScriptPubKeyMans from MigrationData to this wallet, removes the LegacyDataSPKM, and moves transaction and address book entries to watchonly&lowbar;wallet or solvable&lowbar;wallet as needed&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f2e1e59a968), requires&lowbar;capability(0x7f2e11aab728), requires&lowbar;capability(0x7f2e16a01518), requires&lowbar;capability(0x7f2e15f309b8), requires&lowbar;capability(0x7f2e12c6f648)&rsqb;&rsqb;
xref:util/Result.adoc[util::Result&lt;void&gt;]
ApplyMigrationData(
    xref:wallet/WalletBatch.adoc[WalletBatch]& local&lowbar;wallet&lowbar;batch,
    xref:wallet/MigrationData.adoc[MigrationData]& data);
----

== Return Value

Success, or an error if the migration data could not be applied&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *local&lowbar;wallet&lowbar;batch*
| The database batch of this wallet to write through&period;
| *data*
| The migration data to apply&period;
|===


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