Backup-SCVMMServer

Backs up the Virtual Machine Manager database.

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

Path

Required? true
Accept Pipeline Input? false
Position? named
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*"

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Examples

1: Back up the VMM database to a local folder.
PS C:\> Backup-SCVMMServer -VMMServer "VMMServer01.Contoso.com" –Path "D:\VMMBackups" 
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.
2: Back up the VMM database to a network share.
PS C:\> Backup-SCVMMServer -VMMServer "VMMServer01.Contoso.com" –Path "\\SQLServer01\VMMBackups" 
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.
3: Restore the VMM database.
C:\> SCVMMRecover.exe –Path <%backup-folder-path%>\<%backup-file-name%>.bak -Confirm

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

See Also