Backup-SCVMMServer

Backup-SCVMMServer

Backs up the VMM database.

Syntax

Parameter Set: Default
Backup-SCVMMServer -Path <String> [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Detailed Description

The Backup-SCVMMServer cmdlet backs up the Virtual Machine Manager (VMM) database on a VMM server to a local folder or to a remote network share. The folder to which you back up the database must be accessible to the SQL Server.

To determine whether the VMM database is stored locally or on a remote server running Microsoft SQL Server, do the following.

-- On the VMM server, open the Registry Editor.
-- Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager Server\Settings\Sql
-- Examine the value for OnRemoteServer:
---- If it is set to 0, the database is on the local VMM server.
---- If it is set to 1, the database is on a remote SQL server.

After you use the Backup-SCVMMServer cmdlet to back up the VMM database, as demonstrated in Examples 1 and 2, you can use the SCVMMRecover.exe command to restore the database, as demonstrated in Example 3. This command is installed with VMM. This command is not a Windows PowerShell cmdlet. By default, SCVMMRecover.exe is installed in <%system-drive%>\Program Files\Microsoft System Center 2012\Virtual Machine Manager\bin.

IMPORTANT: To back up and restore a server functioning as a virtual machine host or as a library server in a VMM environment, use your standard server backup and restore procedures.

Parameters

-JobVariable<String>

Specifies that job progress is tracked and stored in the variable named by this parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Path<String>

Specifies the destination path for the operation.

Example formats:

Local: -Path "F:\"

UNC: -Path "\\Library\Templates"

Volume GUID: -Path "\\?\Volume{4703c1ea-8ae7-11db-b473-00123f7603e3}\"

VMware ESX: -Path "[storage1]\MyVMwareFolderForVMs\MyVM.vmx"

Citrix XenServer: -Path "Local storage[99b6212f-b63d-c676-25f9-d6c460992de7]"

Wildcards are supported for Get- cmdlets and when you specify the UNC path.

Example format:

UNC: -Path "\\VMHostServer\MyVMs\*VM*"

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid]>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • VMMServer

Examples

Example 1: Back up the VMM database to a local folder

This command backs up the VMM database on the VMM server named VMMServer01 to the specified path.

Note:

-- This cmdlet must back up the database to a server running Microsoft SQL Server. This example assumes that Microsoft SQL Server for the VMM database is installed on VMMServer01 rather than on a remote server.
-- When you back up the database to a local folder, the folder must be write-accessible to the Microsoft SQL Server service.

PS C:\> Backup-SCVMMServer -VMMServer "VMMServer01.Contoso.com" -Path "D:\VMMBackups"

Example 2: Back up the VMM database to a network share

This command backs up the VMM database on the VMM server named VMMServer01 to the specified share on a server called SQLServer01.

Important:

-- This cmdlet must back up the database to a server running Microsoft SQL Server, so this example assumes that Microsoft SQL Server for the VMM database is installed on SQLServer01.
-- When you back up the database to a remote share, the share must be write-accessible to the Microsoft SQL Server service.

PS C:\> Backup-SCVMMServer -VMMServer "VMMServer01.Contoso.com" -Path "\\SQLServer01\VMMBackups"

Example Example 3: Restore the VMM database.

This example demonstrates the use of SCVMMRecover.exe. This is not a Windows PowerShell cmdlet. You must open a Command Prompt window, not a Windows PowerShell session, and use the SCVMMRecover.exe command that is installed with VMM to perform this operation. You must run SCVMMRecover.exe locally on the VMM server on which you want to restore the database. SCVMMRecover.exe does not work with a highly available VMM installation.

This example restores the VMM database to the VMM server where:

<%backup-folder-path%> is the path on the server running Microsoft SQL Server where the .bak file is saved.

<%backup-file-name%> is the name of the .bak file that was created during the backup operation.

This example assumes that SCVMMRecover.exe is installed in the default location for VMM at:

<%system-drive%>\Program Files\Microsoft System Center 2012\Virtual Machine Manager\bin\SCVMMRecover.exe

C:\> SCVMMRecover.exe -Path <%backup-folder-path%>\<%backup-file-name%>.bak -Confirm

Get-SCVMMServer

Set-SCVMMServer