A backup only protects you if a copy lives somewhere other than the server itself. This guide covers the built-in Windows tools and a simple, reliable routine you can set up today.
What to back up
- Your own files: documents, website folders, scripts and settings.
- Database backups (
.bakfiles from SQL Server, not the live database files). - Program data that is hard to rebuild, for example a MetaTrader data folder with your EAs, indicators and templates (File → Open Data Folder in the terminal).
Option 1: copy folders with Robocopy
Robocopy is built into Windows and copies only changed files. This mirrors a folder to a second drive or a network share:
robocopy "C:\inetpub\example" "D:\Backup\example" /MIR /R:2 /W:5 /LOG:"D:\Backup\robocopy.log"Warning: /MIR makes the destination an exact mirror, including deletions. If a file is deleted or encrypted by malware at the source, the next run removes it from the copy too. Keep dated copies or a second, off-server copy as well.
Run it every night with Task Scheduler.
Option 2: Windows Server Backup
Windows Server Backup can back up whole volumes or the full system on a schedule. Install it first:
Install-WindowsFeature -Name Windows-Server-Backup -IncludeManagementToolsThen open wbadmin.msc and choose Backup Schedule or Backup Once. A one-off backup of C: to D: from the command line:
wbadmin start backup -backupTarget:D: -include:C: -allCritical -quietOn Windows 10/11, use File History (Settings → Backup or Control Panel → File History) for your user folders.
Get a copy off the server
A backup on the same server will not help if the server is reinstalled or its disk fails. At least weekly, copy your backups to:
- your own computer (how to transfer files), or
- cloud storage you control, or
- another server.
Snapshots
If your plan includes snapshots, take one in the control panel before big changes such as major updates or software upgrades. Treat it as a quick way back, alongside your file backups rather than instead of them.
Test a restore
Once a month, restore a file or a database backup to a test folder and open it. A backup you have never restored is a guess.
Troubleshooting
- Robocopy exit code 1–7: these are success codes (files copied, extra files, and so on). Codes of 8 and above mean something failed; check the log.
- wbadmin cannot use the target: the target must be a different volume from the one being backed up.
