On this page
A dedicated server has no QuantVPS backups and no restore points. This guide shows you what to copy, where to keep it, and how to check that a copy restores.
On a VPS plan, QuantVPS backups do this for you: see How to Create and Restore QuantVPS Backups.
Why RAID 1 Is Not a Backup
Your dedicated server keeps its data on RAID 1: two drives that hold the same data. If one drive fails, the server keeps running on the other drive and nothing is lost.
RAID 1 writes every change to both drives at the same time. That includes the changes you don't want:
- A file you delete is deleted on both drives.
- A file that a crash or a failed update damages is damaged on both drives.
- Malware that encrypts your files encrypts them on both drives.
- A reinstall erases both drives.
RAID 1 keeps the server running when a drive fails. A backup is a separate copy, kept somewhere else, that brings your files back. You need both.
What to Copy
You don't need to copy Windows or Ubuntu: a reinstall puts them back. Copy what you made and can't download again: your platform's settings, strategies, indicators, templates and workspaces, and your own files.
NinjaTrader 8
Use NinjaTrader's own backup. It saves your settings, trade history, NinjaScript files, templates and workspaces in one file.
- In NinjaTrader, disconnect from all connections.
- In the Control Center, click Tools > Export > Backup File.
- Select Configuration files, Database (Historical trade data), NinjaScript files, Templates and Workspaces. Add Historical chart data and Market replay only if you need them.
- Click Export, choose where to save the file and give it a name, then click Backup.
Unless you choose another folder, NinjaTrader saves the file in Documents\NinjaTrader 8 Backup and names it with the date. Then copy that file off the server (see Where to Keep Your Copies). To restore it, click Tools > Import > Backup File. Pictures of each step: How to Create and Restore NinjaTrader Backups.
MetaTrader 4 and 5
- In MetaTrader, click File > Open Data Folder. Note which folder opens.
- Close MetaTrader.
- Copy that whole folder. MQL4 or MQL5 holds your Expert Advisors, indicators and scripts. Profiles and Templates hold your charts and templates. Config holds the terminal's settings.
Each MetaTrader you install has its own data folder. Open each one from its own File menu.
Other Platforms and Your Own Files
- Other platforms: copy the folders where they keep settings and workspaces. Each platform's own help names them. Official Documentation & Support Links links to it.
- Your own files: the files on your Desktop and in Documents that you use, license keys, and a list of the programs you installed, so you can set the server up again.
Where to Keep Your Copies
Keep at least one copy off the server. A copy on the same drives is lost with them.
- Your own computer: copy the files over Remote Desktop. See How to Transfer Files to Your QuantVPS.
- Cloud storage you own, such as OneDrive, Google Drive or Dropbox: upload the files in a browser, or copy them into the folder of its app. Install the app only if its system requirements list your server's version of Windows or Ubuntu.
- A shared folder on another computer or server you own.
Keep more than one copy, for example one a day for a week and one a week for a month. Then a damaged file that you notice late is still good in an older copy.
Back Up Windows Server
Pick one way. The first is the simplest.
Option 1: Copy the Files Yourself
Make your platform's backup (above), then copy it to your own computer or your cloud storage. Do it after every change you would not want to redo.
Option 2: Copy Every Day With Robocopy
Robocopy is built into Windows. This example copies NinjaTrader's backup folder into a OneDrive folder every day. Use a folder that your cloud storage app syncs on this server, or a shared folder you own. Replace <you> with your Windows user name and use your own folders.
Click Start, type PowerShell, then click Windows PowerShell.
Copy once now, to check that the command works:
robocopy "C:\Users\<you>\Documents\NinjaTrader 8 Backup" "C:\Users\<you>\OneDrive\Server backups\NinjaTrader" /E /Z /R:2 /W:5 /LOG+:C:\Users\Public\Documents\backup-copy.logRun it every day at 17:30 by the server's clock (choose a quiet time for you):
$Action = New-ScheduledTaskAction -Execute 'robocopy.exe' -Argument '"C:\Users\<you>\Documents\NinjaTrader 8 Backup" "C:\Users\<you>\OneDrive\Server backups\NinjaTrader" /E /Z /R:2 /W:5 /LOG+:C:\Users\Public\Documents\backup-copy.log'
$Trigger = New-ScheduledTaskTrigger -Daily -At 17:30
Register-ScheduledTask -TaskName 'Copy-Backups-Daily' -Action $Action -Trigger $Trigger
/E copies every subfolder. /Z continues a large file where it stopped. /R:2 /W:5 tries a failed file twice, 5 seconds apart. /LOG+ adds each run's report to the log file.
- Robocopy copies the files that are in the folder. It does not make NinjaTrader's backup file: make that in NinjaTrader after a change, and the daily copy takes it off the server.
- To copy another folder, such as your MetaTrader data folder, run the same steps with that folder and a new task name.
- The task runs while you are signed in to Windows. If you close the Remote Desktop window without signing out, you stay signed in.
- In Task Scheduler, a last run result from 0x0 to 0x7 means no file failed. 0x8 or higher means some files did not copy: read the log.
Option 3: Windows Server Backup
Windows Server Backup is part of Windows Server, but it is not installed at first. It needs a place to save to that is not part of the backup: a second drive, or a shared folder on another computer you own. On most dedicated servers, that is a shared folder.
- Open Server Manager and click Add roles and features.
- Click Next until you reach Features. Select Windows Server Backup, click Next, then Install. When it finishes, click Close.
- In Server Manager, click Tools > Windows Server Backup, then click Local Backup.
- In the Action menu, click Backup Once.
- Choose Different options, then Custom, and add the folders to back up.
- Choose Remote shared folder (or Local drives for a second drive), choose the location, then click Backup.
To run it every day, click Backup Schedule in the same menu and follow its steps.
Back Up Ubuntu
On Ubuntu, rsync copies folders to another computer over SSH. After the first copy, it sends only what changed. Replace trader with your user name, and you@your-backup-computer with the computer you copy to.
Choose what to copy: your home folder (for example
/home/trader/) and your platform's folders.Try a dry run first. It lists what would be copied and changes nothing:
rsync -av --dry-run /home/trader/ you@your-backup-computer:/backups/quantvps/home/Run it for real, without
--dry-run:rsync -av /home/trader/ you@your-backup-computer:/backups/quantvps/home/To run it every day at 22:30 by the server's clock, run
crontab -eand add this line:30 22 * * * rsync -a /home/trader/ you@your-backup-computer:/backups/quantvps/home/
-a keeps permissions, owners and dates. The / at the end of /home/trader/ copies what is inside the folder, not the folder itself.
The daily line must sign in without you. On the server, make an SSH key with no passphrase (ssh-keygen -t ed25519, then press Enter at the passphrase prompt) and copy it to the backup computer (ssh-copy-id you@your-backup-computer).
To keep daily and weekly copies that you can go back to, Ubuntu's documentation describes rsnapshot, a tool built on rsync.
How Often to Back Up
- After every change you would not want to redo: a new strategy, workspace, template or setting.
- Before you update your platform or Windows, and before a reinstall.
- Every day you trade, if you change things often. Otherwise, at least once a week.
Test a Restore
A backup that you have never restored may not work. Test one when you set up your backups, then once a month. Restore to a new folder, never over your live files.
- NinjaTrader: check that the backup file has today's date and is not 0 KB. An import (Tools > Import > Backup File) changes the NinjaTrader you import it into, so test the import on a computer where that is fine.
- Folder copies (Robocopy, rsync, MetaTrader): copy a few files back into a new folder and open them.
- Windows Server Backup: click Recover, choose the backup's date, choose Files and folders, then restore to Another location.
What QuantVPS Support Can Do
- We cannot restore files on a dedicated server, because we keep no copy of them.
- We can help you choose what to copy and check your backup plan.
- If Remote Desktop or SSH does not connect, you can still reach the server through the console: see How to Access Your Dedicated Server Using Console (KVM).
- Detect+ shows each drive and the state of the RAID. If it reports a drive problem, copy your important files first, then contact us.
Need Assistance?
Our support team is available 24/7. If you have any questions or run into issues, open a support ticket from your QuantVPS dashboard and we'll get back to you as quickly as possible.
