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!
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 the previous command line utility, NTBackup, and allows you to back up or recover operating system (OS), drive volumes, computer files and folders, and 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. This file can be mounted in Windows Disk Manager.
Specifically, with the help of Wbadmin, you can enable, create, restore, disable, stop, and delete a backup, and get information about the backup and its content. For the detailed WBadmin syntax and explanation, you can refer to the Microsoft TechNet website.
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.
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.
3. Press Install, and it will start to install this feature automatically. After this process completes, just close this window.
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
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 a 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.
Like the backup operations, here are 4 examples of restoring backups with Windows Server 2012 Wbadmin. To perform bare metal recovery, you need to boot into Windows Recovery Environment and open the 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
Notes: โ To restore a backup, you need to type the following commands to get the backup version identifier and backup location. Please note the drive letter may change under Windows RE, so a 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 the hyper-v backup created on June 17, 2020, at 06:28, and the backup location is E: drive, type 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.
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 the 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:
๐ Example 2: To delete all system state backups 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 images. 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.
It still has some limitations, for example, it only works for partitions 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 professional server backup software.
Except for Wbadmin, you can still use third-party server backup software with a graphic user interface. AOMEI Backupper Server is a great option, widely used in all the Windows operating systems, including 2003/2008 (R2)/2012 (R2)/2016 (R2)/2019/2022 and Windows XP/Vista/7/8/8.1/10/11.
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. It supports partitions or disks formatted with all file systems, 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 the Wbadmin alternative - AOMEI Backupper Server. Here are the steps.
To create a disk backup, for example, you need to download and open this software, click “Backup” and “Disk Backup”.
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 disks one by one.
After that, click the inverted triangle icon to select a destination to receive your backup. You have two choices in the following:
Now, you can directly click “Start Backup” to start the backup task.
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".
Tip: To back up multiple servers, it's suggested to create a portable version of this software with its technician or technician plus edition, and then you can use it on any PC without installing it again.
To restore the 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.
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.
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".
After that, in the Disk Restore window, select the restore destination to receive the backup image. Then, click "Next".
Now, you need to confirm the restore info and click “Start Restore” to restore Windows Server 2012.
๐ Other options you may need:
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 professional server backup software with a graphic user interface, and AOMEI Backupper Server is a great option.
With it, you can schedule backup disks, systems, partitions, and files effortlessly and delete old backups automatically to make up for more space. At the same time, you can restore backup images respectively, if it's a system or disk backup, you can use it on a computer with dissimilar hardware. Also, this software supports command line utility for advanced users.