Start-VEMDBRestoreJob
Short Description
Restores MongoDB collections or the entire MongoDB instance.
Applies to
Veeam Backup & Replication
Product Edition: Enterprise Plus, Veeam Universal License
Syntax
This cmdlet provides parameter sets that allow you to:
- Restore collections to a target MongoDB deployment.
|
Start-VEMDBRestoreJob [-InstancePort <Int32>] [-InstanceCredentials] <PSCredential> [-Server <String>] [-SshPort <Int32>] -Credential <VEMDBLinuxCredentials> [-UseTLS] [-Collections] <VEMDBCollectionRestoreOptions[]> [-RestoreAdminDatabase] [-Force] [<CommonParameters>] |
- Restore an entire MongoDB instance to a target Linux machine with MongoDB.
|
Start-VEMDBRestoreJob [-InstancePort <Int32>] [-Server <String>] [-SshPort <Int32>] -Credential <VEMDBLinuxCredentials> [-Session] <VEMDBRestoreSession> [[-DataFolderPath] <String>] [-Force] [<CommonParameters>] |
Detailed Description
This cmdlet restores backed-up MongoDB collections or the entire backed-up MongoDB instance. After you start a restore job, you can stop the restore process with the Stop-VEMDBRestoreJob cmdlet.
Parameters
|
Parameter |
Description |
Type |
Required |
Position |
Accept Pipeline Input |
|---|---|---|---|---|---|
|
Collections |
For collections restore. Specifies the collections and their restore options. |
Accepts the VEMDBCollectionRestoreOptions[] object. To get this object, run the New-VEMDBCollectionRestoreOptions cmdlet. |
True |
0 |
False |
|
Session |
For instance restore. Specifies a restore session initiated to perform operations with MongoDB. |
Accepts the VEMDBRestoreSession object. To get this object, run the Get-VEMDBRestoreSession cmdlet. |
True |
0 |
False |
|
InstanceCredentials |
For collections restore. Specifies the credentials for the target MongoDB instance. Note: The user must have the root MongoDB role on the target replica set. |
Accepts the PSCredential object. To get this object, run the Get-Credential cmdlet. |
True |
1 |
False |
|
DataFolderPath |
For instance restore. Specifies the path to which the cmdlet will restore the MongoDB instance. Note: If you do not specify this parameter, the instance will be restored to the original location. |
String |
False |
1 |
False |
|
Credential |
Specifies credentials for authenticating to the primary node of the MongoDB deployment or the target MongoDB server. Note: The user must have root privileges on the target server. |
Accepts the VEMDBLinuxCredentials object. To get this object, run the New-VEMDBLinuxCredentials cmdlet. |
True |
Named |
False |
|
Force |
Defines that the cmdlet will overwrite existing MongoDB data with data from the backup. Note: The cmdlet will show no prompt before executing the command. |
SwitchParameter |
False |
Named |
False |
|
InstancePort |
Specifies the port of the target MongoDB instance. Default: 27017 |
Int |
False |
Named |
False |
|
RestoreAdminDatabase |
For collections restore. Defines that the cmdlet will restore the admin database. |
SwitchParameter |
False |
Named |
False |
|
Server |
Specifies DNS name or IP address of the primary node of the target MongoDB deployment or the target MongoDB server. |
String |
False |
Named |
False |
|
SshPort |
Specifies the SSH port number that the cmdlet will use to connect to the Linux machine. Default: 22 |
Int |
False |
Named |
False |
|
UseTLS |
For collections restore. Defines that the cmdlet will connect to the target MongoDB deployment using a secure TLS protocol. |
SwitchParameter |
False |
Named |
False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About Common Parameters section of Microsoft Docs.
Output Object
The cmdlet returns the VEMDBRestore object, that contains information about the status of the MongoDB restore job.
Examples
Example 1. [For Collections Restore] Restoring Specific Collection With Default Settings
|
This example shows how to restore a MongoDB collection to the original location. The collection will retain the original name. This example will also restore the admin database to the original location.
Perform the following steps:
The cmdlet will return an array of active restore sessions. Note the ordinal number of the necessary restore session. In our example, it is the first restore session in the array.
Save the result to the $restore variable to be able to use it with other cmdlets. |
Example 2. [For Collections Restore] Restoring All Collections in a Replica Set With Default Settings
|
This example shows how to restore all MongoDB collections in the replica set to the original location. Each collection will be restored with the original name, to the same database as on the backup. If any of the collections exist on the target server, the cmdlet will overwrite them without issuing a prompt.
Perform the following steps:
The cmdlet will return an array of restore sessions. Note the ordinal number of the necessary restore session. In our example, it is the first restore session in the array.
Save the result to the $restore variable to be able to use it with other cmdlets. |
Example 3. [For Collections Restore] Restoring Collections With Custom Restore Options
|
This example shows how to restore specific MongoDB collections to another location. The collections will be restored with different names, to a new database. This example uses a custom SSH port to connect to the target server and it will use the TLS protocol to connect to the target MongoDB deployment.
Perform the following steps:
The cmdlet will return an array of active restore sessions. Note the ordinal number of the necessary restore session. In our example, it is the first restore session in the array.
Save the result to the $restore variable to be able to use it with other cmdlets. |
Example 4. [For Instance Restore] Restoring Entire MongoDB Instance
|
This example shows how to restore the entire instance to a target Linux machine with MongoDB. If the specified path on the target server is not empty, the cmdlet will overwrite its contents without issuing a prompt.
Perform the following steps:
Save the result to the $restore variable to be able to use it with other cmdlets. |
Related Commands