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

Restore a wallet from a backup file&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::shared&lowbar;ptr&lt;CWallet&gt;
RestoreWallet(
    xref:wallet/WalletContext.adoc[WalletContext]& context,
    xref:fs/path.adoc[fs::path] const& backup&lowbar;file,
    std::string const& wallet&lowbar;name,
    std::optional&lt;bool&gt; load&lowbar;on&lowbar;start,
    xref:wallet/DatabaseStatus.adoc[DatabaseStatus]& status,
    xref:bilingual_str.adoc[bilingual&lowbar;str]& error,
    std::vector&lt;bilingual&lowbar;str&gt;& warnings,
    bool load&lowbar;after&lowbar;restore = true,
    bool allow&lowbar;unnamed = false);
----

== Return Value

The restored wallet, or nullptr on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *context*
| The wallet context to restore into&period;
| *backup&lowbar;file*
| Path to the backup file to restore from&period;
| *wallet&lowbar;name*
| The name to give the restored wallet&period;
| *load&lowbar;on&lowbar;start*
| Optionally set whether the wallet loads on startup&period;
| *status*
| Set to the database status&period;
| *error*
| Set to an error message on failure&period;
| *warnings*
| Warnings produced while restoring&period;
| *load&lowbar;after&lowbar;restore*
| Whether to load the wallet after restoring&period;
| *allow&lowbar;unnamed*
| Whether an empty wallet name is allowed&period;
|===


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