Windows Server 2012 Wbadmin Backup and Restore Tutorial

This article is to illustrate how to use Windows Server 2012 Wbadmin or an easier alternative to backup, restore or delete images. Get it now!

Ivy

By Ivy Updated on October 20, 2022

Share this: instagram reddit

📖 Quick Navigation:

Overview of Wbadmin commands

Wbadmin is a built-in command-line tool for Windows Vista/7/8/10/11 and Windows Server 2008/2008 R2/2012/2016/2019/2022. It replaces previous command line utility, NTBackup and allows you to backup or recover operating system (OS), drive volumes, computer files and folders, apps from an elevated command prompt.

The backup files are saved as Microsoft’s Virtual Hard Disk (.VHD) files with some accompanying .xml configuration files. And this file can be mounted in Windows Disk Manager.

Specifically, with the help of Wbadmin, you can enable, create, restore, disable, stop, delete backup, and get information of backup and its content. For the detailed WBadmin syntax and explanation, you can refer to the Microsoft TechNet website.

How to use Wbadmin in Windows Server 2012

Here you will learn how to use Wbadmin syntax to backup, restore and delete backups in the Windows Server 2012. Also, this command works for later operating systems, such as 2012 R2, 2016, 2019, and 2022. Please note the use of Wbadmin requires Windows Server Backup installed on your server computer.

Install Windows Server Backup before using Wbadmin

1. Open Server Manager, and select Manage > Add Roles and Features.

2. Choose the default settings until go to the Select Features window, scroll down and select Windows Server Backup, and click Next.

Install Windows Server Backup

3. Press Install, and it will start to install this feature automatically. After this process completes, just close this window.

Run Wbadmin to backup Windows Server 2012

Here you will see four examples to backup Windows Server 2012 with Wbadmin, including bare metal backup, backup to network share, hyper-v backup and Wbadmin scheduled backup Server 2012. Let's get it on.

💙 Example 1: To do a bare metal backup to E: drive with the following command:

wbadmin start backup -backuptarget:e: –include:c: -allcritical -systemstate -vssfull

Wbadmin Bare Metal Backup

Note: The -allcritical switch will include all items for a bare metal recovery. Whether you add -systemstate switch or not, it makes no difference to what will be included in the backup, leaving you the option to run a system state recovery without restoring the whole server.

💙 Example 2: To create a backup that includes C: drive and Video folder on D: drive to the network drive:

wbadmin start backup -include:c:,d:\video -backuptarget:\\192.168.1.222\backup -user:1 -password:1 -quiet

Notes:
When you specify more than one item with -include: switch, use commas to separate them without space.
The -user and -password switch is needed when specifying a network location as the backup target.
✔ The -quiet switch means this backup will run without prompting you.
You can also specify more than one time of a day to run the backup.

💙 Example 3: To start a Windows Server 2012 hyper-v backup for virtual machine, and save it to C drive:

wbadmin start backup –backuptarget:c:  –hyperv: “Server 1”

💙 Example 4: To create a daily scheduled system state backup to G: drive:

wbadmin enable backup -addtarget:g: -systemstate -schedule:06:44

Note: The -schedule switch is to specify the time to run the WBadmin scheduled backup.

Wbadmin restore backup in Windows Server 2012

Like the backup operations, here are 4 examples to restore backup with Windows Server 2012 Wbadmin. To perform bare metal recovery, you need to boot into Windows Recovery Environment and open command prompt.

💙 Example 1: To restore a backup created on June 17, 2020 at 04:41, and saved on E drive, type as follows.

wbadmin start sysrecovery –version: 06/17/2020-04:41 –backuptarget:e: -machine: Server 1

Wbadmin Bare Metal Recovery

Notes:
To restore a backup, you need to type the following commands to get backup version identifier and backup location. Please note the drive letter may change under Windows RE, so GUID-based path will be a better choice.
   • To find out the backup version identifier: wbadmin get versions –backup target:
   • To get the volume GUID-based path: mountvol
✔ To list items of a backup, use "wbadmin get items –version: -backuptarget:".
The parameter "-machine:" is only used when you backup multiple computers to the same backup target. 

💙 Example 2: To restore a backup on network location, run the following command.

wbadmin start recovery –version: 06/17/2020-05:33 –backuptarget: \\192.168.1.222\backup -machine: Server 1

💙 Example 3: To restore hyper-v backup created on June 17, 2020 at 06:28, and the backup location is E: drive, type as the following command.

wbadmin start recovery –version:06/17/2020-06:28 –itemtype:hyperv –items:”Server 1” -backuptarget:e:

💙 Example 4: To restore a system state backup created on June 17, 2020, at 06:44, and saved on E drive, type the following commands.

wbadmin start systemstaterecovery -version:06/17/2020-06:44 –backuptarget:e:

Note: If you want to specify the backup location, you could add –backuptarget parameter.

Delete Windows Server 2012 backup with Wbadmin

Your backup disk will be full sooner or later as the increasing number of backups, so deleting old backup on Windows Server 2012 is imminent. Here are three parameters you need to know, which can help you delete backup files, whether it's system state backup or non-system state backup.

  • [-version]: to delete specific version(s)

  • [-keepVersions]: to delete all backups but the specified versions

  • [-deleteOldest]: to delete the oldest backup

💙 Example 1: To delete non-system state backup taken on June 17, 2020 at 06:22, and saved to E drive, copy and paste the command below.

wbadmin delete backup -version: 06/17/2020-06:22 -backupTarget:e:

Wbadmin Delete Backup

💙 Example 2: To delete all system state backup on E drive except the latest three versions, run the command below.

wbadmin delete systemstatebackup -keepVersions:3 -backupTarget:e:

Note: In Windows Server 2008 R2 or other previous versions of Windows Server, WSB does not allow you to directly delete non-system state backups. As a workaround, you can delete the corresponding shadow copy on the backup target location. To delete shadow copy, you could use the command line "diskshadow".

That's all for how to use Windows Server 2012 Wbadmin. If you are familiar with Wbadmin syntax and necessary parameters, you can easily backup, restore and delete image. If not, you may feel it's a big headache. You need to learn all the necessary syntax and parameters, and any small error may result in operation failure. 

And it still has some limitations, for example, it only works for partition formatted with the NTFS file system, you can only create one schedule backup, etc. Thus, you may want an easier way to backup and restore Windows Server 2012. You could use a professional server backup software.

Easier way to perform Windows Server 2012 backup and restore

Except for Wbadmin, you can still use a third-party server backup software with graphic user interface. AOMEI Backupper Server is a great option, widely used in all the Windows opeating systems, including 2003/2008 (R2)/2012 (R2)/2016 (R2)/2019/2022 and Windows XP/Vista/7/8/8.1/10/11.

You can select backup solutions as you like, such as, system backup, disk backup, partition backup, file backup
You can set the backup frequency you want, such as daily/weekly/monthly schedule backup.
You can also backup at a specific event with event triggers or use dedicated storage device for backup, backup computer to USB flash drive automatically with USB plug in feature, for example.
You can choose to backup only changed files with incremental and differential backup instead of backup everything.
You can also set how to delete old backups, such as by quantity, by time, by daily/weekly/monthly and by space.

Besides these features, it still works well in any detected storage by Windows, for example, internal/external hard disks, solid-state drives (SSD), USB flash drives/pen drives, hardware RAID array, dynamic disk, and network share. And it supports partitions or disks formatted with all file system, not just NTFS, such as FAT32, FAT16, EXT2, and EXT3.

Now, let’s have a closer look at how to perform Windows Server 2012 backup and restore with Wbadmin alternative - AOMEI Backupper Server. Here are the steps. 

Backup Windows Server 2012 with AOMEI Backupper Server

To create a disk backup, for example, you need to download and open this software, click “Backup” and “Disk Backup”. 

Download Free Trial Window server 2012/2016/2019 /2022
Secure Download

Backup Windows Server 2012

Note: If you want to create system backup, partition backup or file backup, click the corresponding backup type and follow its on-screen instructions.

 Then, you will see the Disk Backup page, click "Add Disk" to select the disk you want to backup. To add multiple disks, click the "+" icon to select disk one by one.

Add Disk

After that, click the inverted triangle icon to select a destination to receive your backup. You have two choices in the following: 

  • Select a local path: It helps you to backup Windows Server 2012 to external hard drive (HDD or SSD) and USB drive.
  • Add Share or NAS Devices: It allows you to backup Windows Server 2012 to network drive, or NAS device. It requires you to type the network path and select the shared folders on it. 

Select Backup Destination

Now, you can directly click “Start Backup” to start the backup task. 

Backup Windows Server 2012

If you want to make the backup task more flexible, you need to add some backup settings in the "Options", "Schedule Backup", and "Backup Scheme".

  • For backup options: You can enable email notification, encryption, compression, comment, pre/post-command, etc.
  • For schedule backup frequencies: You can set up automatic backup daily, weekly, monthly, and if the target drive is external device, you need to connect it before the task start every time. 

Schedule Settings General

  •  For specific events or devices: Try Event triggers if you want to backup Server 2012 at specific events or USB plug in" to backup it from or to USB when it's plugged in. 
  • For backup methods: it's recommended to backup only changed files with incremental or differential backup, thereby largely saving backup time and disk space.
  • For cleanup methods: You can select them based on its rule, such as, the number of backup sets or exceeding days.

Backup Scheme

Tip: To backup multiple servers, it's suggested to create a portable version of this software with its technician or techplus edition and then you can use it on any PC without installing again. 

Restore Windows Server 2012 with AOMEI Backupper Server

To restore backup created by AOMEI Backupper Server, go to the “Restore”  tab and then choose “Select Task” or “Select Image File”, depending on if your backup can be recognized directly.

Select Task

Note: If your computer is unbootable, you need to create a Windows Server 2012 recovery disk on a working computer first and then restore the failing computer. 

If you choose "Select Task", you will be asked to select the backup image you want to restore. If you choose "Select Image File", please directly go to the next step.

Restore Windows Server 2012 Backup

Then, you need to select the items you want to restore. Select "Restore the entire disk" if you want to restore everything from this backup and click "Next".

Restore Entire Disk

After that, in the Disk Restore window, select the restore destination to receive the backup image. Then, click "Next". 

Select Destination Disk

Now, you need to confirm the restore info and click “Start Restore” to restore Windows Server 2012.

Restore Windows Server 2012

👉 Other options you may need:

  • "SSD Alignment": If the restore destination is an SSD disk, you can tick this feature to accelerate its reading and writing speed. 
  • "Edit Partitions": If the destination disk is larger, you need to adjust the partition size of it. Otherwise, the destination disk will not show full capacity
  • "Universal Restore": If you want to backup and restore disk image to new computer with dissimilar hardware, you can tick this feature to resolve the driver is incompatible. 
  • "AOMEI Image Deploy": It helps you to deploy backup images to multiple computers, even unlimited ones, as long as your computer support booting from PXE or network. And it requires a technician or techplus edition. 

Wrapping things up

That's all for how to use Windows Server 2012 Wbadmin commands. You can follow the example to backup, restore or delete images as you want. For novices, it's suggested to use a professional server backup software with graphic user interface, and AOMEI Backupper Server is a great option.

With it, you can schedule backup disk, system, partition and files effortlessly and delete old backup automatically to make up for more space. At the same time, you can restore backup image respectively, if it's a system or disk backup, you can use it on computer with dissimilar hardware. Also, this software supports command line utility for advanced uers. 

Ivy
Ivy · Editor
Ivy is an editor of AOMEI Technology, she covers backup & restore,hard disk & partitions management and cloud files transfer and so on for AOMEI. She is an outgoing girl and enjoys helping people find solutions to their problems. She loves traveling, eating, reading and so on. She usually hangs out with friends at her leisure time.