Overview of Wbadmin commands
Wbadmin is a built in command-line tool for Windows Vista/7/8/10 and Windows Server 2008/2008 R2/2012. 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.
Specificly, 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.
Then, scroll down to the following parts and learn all instructions related to Wbadmin backup Windows Server 2012 and restore.
Backup Windows Server 2012 using Wbadmin
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 differences 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
1. When you specify more than one item with -include: switch, use commas to separate them without space.
2. The -user and -password switch is needed when specifying a network location as the backup target.
3. The -quiet switch means this backup will run without prompting you.
4. You can also specify more than one times 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.
Restore Windows Server 2012 by Wbadmin
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 follow.
wbadmin start sysrecovery –version: 06/17/2020-04:41 –backuptarget:e: -machine: Server 1
1. To restore a backup, you need to get backup version identifier, backup location, type the following commands. Please note the drive letter may change under Windows RE, so GUID-based path will be better choice.
• To find out the backup version identifier: wbadmin get versions –backup target: <location to save backup>
• To get the volume GUID-based path, mountvol
2. To list items of a backup, wbadmin get items –version: <backup version identifier> -backuptarget: <location to save backup>
3. -machine: the paramether is only used when you backup multiple computer 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 paramether.
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:
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".
Windows Server 2012 backup software –best alternative to Wbadmin
Wbadmin command line utility only can be used on partitions or volumes formatted with NTFS file system. And it has many syntax that is not easy for many users to learn. Fortunately, you could use a server backup software with user graphic to backup a server. Here I strongly recommend you AOMEI Backupper Server.
It can be a good Windows Server 2012 Wbadmin commands alternative, widely used in all the Windows opeating system, including 2003/2008(R2)/2012(R2)/2016(R2)/2019 and Windows 7/8/8.1/10/XP/Vista. Below are the advantages of this software.
Support full backup solutions, namely system backup, disk backup, partition backup, file backup.
Support many useful schedule backup settings, such as, daily/weekly/monthly backup, incremental and differential backup, event triggers, USB plug in.
Allow you to delete old backups to free up disk space with 5 different methods.
Work well in any detected storage by Windows, for example, the internal/external hard disks, the solid state drives (SSD), the USB flash drives/pen drives, the hardware RAID array, the dynamic disk, and the network share.
Support partitions or disks formatted with all file system, not just NTFS, such as, FAT 32, 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”, then select backup disk and destination path, finally click “Start Backup”.
Note: If you want to create system backup, partition backup or file backup, click the corresponding backup type and follow its on-screen intructions.
To customize your backup task, select one backup solution, here is "Disk Backup" and then you will see three options at the lower location. Click "Options" to enable emmail nofication, encryption, compression, comment, pre/post-command etc. Click “Schedule” to set up automatic backup. Click “Scheme” and "Enable Backup Scheme" to delete old backup files while keep the latest backups.
Daily/weekly/monthly backup: These backup settings allow you to backup system, disk, partition and files at a regular basis, so your will never miss any changes, such as, modified files and newly installed programs.
USB plug in: This feature will automatically backup your files from or to USB flash drive when it's detected. The premise is to create a schedule backup with USB plugged in first.
Event triggers: This feature gives you four choices to backup at specific events, including system startup, system shutdown, user logon, user logoff.
Incremental or differential backup: Both features only backup changed or newly added data instead of backing up all data every time. It largely saves backup time and disk space for users.
About Backup Scheme:
This software provides users with fives different options in total to avoid backup disk full and you can check its explannation and then select one based on your needs.
Please note that the backup will be perform in the way you set in scheme if you enable both schedule and scheme. For example, if you enable differential backup and incremental backup scheme, the backup task will run as an incremental backup.
Restore Windows Server 2012 with AOMEI Backupper Server
To restore backup created by AOMEI Backupper Server, click “Restore” and “Select Task” or “Select Image File”, then choose disk backup and destination path, finally click “Start Restore”.
• 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.
• For advanced users, AOMEI Backupper also provides you a command line utility AMBackup.exe to backup Server 2012 and restore it when needed. Compared with Wbadmin, it’s very easy to understand.
Wrapping things up
That's all for how to use Windows Server 2012 Wbadmin commands. Please note that backup partitions or volumes requires to be NTFS file system. And this command line has many syntax which is a little tricky for lots of users to master. Therefore, it's suggested to use a backup software with GUI interface, AOMEI Backupper Server, for example, so users can understand and use it easily and quickly.
With it, you can backup disk, system, partition and files effortlessly. Also, it allows you to customize the backup settings by clicking "Options", "Schedule" and "Scheme". In addition, it still allows you to restore your computer, even with dissimilar hardware, thanks to the universal restore feature. More so, you can directly clone hard drive and system to migrate server computer without restore operation.