*Cube-Host– full cloud services!!

Automatic backup on Windows VPS

Automatic backup on Windows VPS

Automated backups are the simplest way to protect a Windows VPS from accidental deletion, ransomware, failed updates, or disk corruption. In this guide you’ll set up Windows Server Backup (WSB), automate wbadmin runs with Task Scheduler, keep multiple versions with date-based folders, and add quick file-level snapshots with Robocopy and VSS.

For predictable backup jobs and stable disk throughput, choose a reliable Windows VPS with enough storage and I/O performance to store and transfer backup sets.

What and Where to Back Up (Quick Checklist)

  • Objects: volumes/files, System State (registry, boot loader, etc.), and application data where applicable (e.g., MSSQL has its own dumps).
  • Destination: separate VPS disk/volume, NAS/file server via SMB, or cloud storage. For local storage, keep NTFS rights limited to SYSTEM and administrators.
  • Policy: daily backups (incremental/full depends on target), weekly full (optional), retention of N versions (e.g., 14–30).
  • Readiness criteria: backup runs without errors, logs are readable, test restore is performed periodically.

Rule #1: don’t store backups only on the same disk as the system. If the VPS is compromised or the disk fails, you lose both server and backup.

Installing the Windows Server Backup (WSB) Component

Windows Server Backup is a built-in feature for scheduled backups of volumes/files and (depending on the mode) system recovery components.

Install via PowerShell (Run as Administrator):

Install-WindowsFeature Windows-Server-Backup -IncludeManagementTools

Verify installation:

Get-WindowsFeature Windows-Server-Backup
Installing Windows Server Backup feature on Windows VPS

Prepare the Target Folder and Permissions

For network storage, create a dedicated directory and grant Read/Write only to SYSTEM, Administrators (or Domain Admins), and (if needed) the backup account/computer object.

Preparing backup folder permissions for Windows Server Backup

Important: the Windows Server Backup GUI wizard has a limitation for network targets: it typically keeps only one “current” copy. To keep multiple versions on a network share, use wbadmin with date-based folders (next section) and rotate old folders yourself.

wbadmin Script: Daily Backup to Date-Based Folders

This approach creates a folder like \\backup-srv\win-vps01\YYYY-MM-DD\ and writes a backup there. This is the simplest way to keep many versions on a network share.

Create a folder for scripts, for example C:\Scripts, and create a PowerShell file:

New-Item -ItemType Directory -Path C:\Scripts -Force
notepad C:\Scripts\WSB-DailyBackup.ps1

Example script (edit paths and volumes to match your VPS):

$ErrorActionPreference = "Stop"

# Base path for backups (network share or secondary disk)
# Examples:
# $Base = "\\NAS01\Backups\winvps01"
# $Base = "D:\Backups\winvps01"
$Base = "\\BACKUP-SERVER\Backups\winvps01"

$Date = Get-Date -Format "yyyy-MM-dd"
$Target = Join-Path $Base $Date

New-Item -ItemType Directory -Path $Target -Force | Out-Null

# Log file
$LogDir = "C:\Windows\Logs"
$Log = Join-Path $LogDir ("WSB-" + $Date + ".log")

"=== START: $(Get-Date) ===" | Out-File -FilePath $Log -Append

# Full backup of critical volumes + system recovery components
# -allCritical includes volumes required to recover Windows (typical baseline)
# Add -include:D: if you want additional data volumes.
wbadmin start backup -backupTarget:$Target -allCritical -quiet 2>&1 | Out-File -FilePath $Log -Append

"=== END: $(Get-Date) ===" | Out-File -FilePath $Log -Append

Logs: you can also inspect WSB logs in C:\Windows\Logs\WindowsServerBackup\*.log.

Windows Server Backup logs example

If you back up to a locally attached disk and want to limit versions using WSB itself:

# Keep only N versions (example: 14)
wbadmin delete backup -keepVersions:14 -quiet

Scheduler: Automatic Script Launch

Option 1: via GUI (Task Scheduler)

Open taskschd.mscCreate Task… → run as SYSTEM + Run with highest privileges. Add a daily trigger and an action:

powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\Scripts\WSB-DailyBackup.ps1

Creating a scheduled task for backup on Windows VPS
Task Scheduler trigger configuration for daily backup
Task Scheduler action configuration to run PowerShell backup script
Task Scheduler settings for running backups as SYSTEM
Task Scheduler overview for the backup task

Option 2: via command line (fast and reproducible)

Create a scheduled task that runs daily at 03:00 as SYSTEM with highest privileges:

schtasks /Create /TN "WSB Daily Backup" ^
 /TR "powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\Scripts\WSB-DailyBackup.ps1" ^
 /SC DAILY /ST 03:00 /RU "SYSTEM" /RL HIGHEST /F

Check last run result:

schtasks /Query /TN "WSB Daily Backup" /V /FO LIST

“Quick” File Versions: Robocopy (+ Daily Folders)

For file-heavy data (websites, uploads, documents), Robocopy snapshots can be faster than full system backups and easier to restore at file level.

Example PowerShell snippet (create a dated folder and copy files):

$Base = "\\BACKUP-SERVER\Backups\winvps01-files"
$Date = Get-Date -Format "yyyy-MM-dd"
$Dest = Join-Path $Base $Date

New-Item -ItemType Directory -Path $Dest -Force | Out-Null

# Example: copy website data
robocopy "C:\inetpub\wwwroot" $Dest /E /Z /R:2 /W:5 /COPY:DAT /DCOPY:T /XJ /LOG+:("C:\Windows\Logs\Robocopy-" + $Date + ".log")

Note: avoid /MIR unless you fully understand that it can delete files in the destination to match the source.

Robocopy backup example on Windows VPS

Enable VSS Snapshots (Shadow Copies) for Quick Rollback

Shadow copies provide “previous versions” and help restore individual files quickly. They are useful for quick rollback, but they are not a replacement for offsite backups because they usually live on the same storage.

Reserve 10–20% of the disk for shadow copies (example for C:):

vssadmin add shadowstorage /for=C: /on=C: /maxsize=20%
Enabling Volume Shadow Copy on Windows VPS

Create a snapshot (example) and list snapshots:

wmic shadowcopy call create Volume="C:\\"
vssadmin list shadows
Listing VSS shadow copies on Windows VPS

To access a snapshot, you can create a read-only directory link to the shadow copy device path (run as Administrator). Replace HarddiskVolumeShadowCopyX with the correct ID from vssadmin list shadows:

mklink /d C:\ShadowCopy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopyX\
Accessing a VSS snapshot via mklink on Windows VPS

After copying the required files, remove the link:

rmdir C:\ShadowCopy

Check, Monitor, Rotate

  • Recovery test: periodically restore a few files (and for critical roles, follow service-specific restore procedures).
  • Logs: check C:\Windows\Logs\WindowsServerBackup\ and your script logs.
  • Rotation: delete old date folders (PowerShell) and/or keep only N WSB versions on local disk.

Example rotation for date folders (keep last 30 days):

$Base = "\\BACKUP-SERVER\Backups\winvps01"
$KeepDays = 30

Get-ChildItem $Base -Directory | Where-Object {
    $_.Name -match '^\d{4}-\d{2}-\d{2}$' -and $_.CreationTime -lt (Get-Date).AddDays(-$KeepDays)
} | Remove-Item -Recurse -Force

Common Problems and Solutions

  • “Only one copy is stored on the network target.” That’s a WSB wizard limitation. Use wbadmin + date-based folders and your own rotation.
  • Task Scheduler hangs or asks for a password. Run the task as SYSTEM with highest privileges and use -ExecutionPolicy Bypass.
  • No space for VSS. Increase shadow storage quota (10–20%) or reduce snapshot frequency.
  • Backup is slow. Check disk I/O and network throughput; consider storing backups on a dedicated disk or external storage.

Conclusion

A production-ready Windows VPS backup strategy usually combines: scheduled system/volume backups (WSB/wbadmin), offsite storage, clear logging, retention rotation, and periodic restore tests. Add Robocopy snapshots for fast file restores and VSS for quick rollback — but always keep at least one copy outside the VPS.

Deploy a Windows VPS Ready for Automated Backups

Need stable disk I/O, enough space for retention, and predictable backup performance? Order a reliable Windows VPS and automate backups from day one using the workflow above.

Prev