Backup-SCVMMServer

Applies To: System Center 2012 - Virtual Machine Manager

Backup-SCVMMServer

Backs up the Virtual Machine Manager 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 System Center 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.

How to Determine Whether SQL Server Is Local or on a Remote Server

------------------------------------------------------

If you do not know whether the VMM database is stored locally or on a remote server running Microsoft SQL Server, do the following:

1. On the VMM server, open the Registry Editor.

2. Navigate to:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\

Microsoft System Center Virtual Machine Manager Server\Settings\Sql

3. Look at 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.

Restoring the Backed-up Database

--------------------------------

After you use the Backup-SCVMMServer cmdlet to back up the VMM database (see Examples 1 and 2), you can use the SCVMMRecover.exe command to restore the database (see Example 3). This command (which is not a Windows PowerShell cmdlet) is installed with VMM. By default, SCVMMRecover.exe is installed at <%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.

For more information about Backup-SCVMMServer, type: "Get-Help Backup-SCVMMServer -online".

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 -Path "F:\"

UNC path -Path "\\Library\Templates"

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

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

Citrix XenServer path - 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 -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.

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

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:

- Backup-SCVMMServer 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"

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:

* Backup-SCVMMServer 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"

3: Restore the VMM database.

This example demonstrates the use of SCVMMRecover.exe, and not a Windows PowerShell cmdlet. You must open a Command Prompt window (not a Windows PowerShell window) 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