Backups & Restore
Everything VolNinja knows (your positions, orders, templates, strategies, rules, and history) lives in one trading database on your own machine. A backup is a copy of that database at a moment in time. You can take one whenever you like, VolNinja takes one for you before every update, and you can restore any of them later.
Backups stay on your machine, like the rest of your trading data. Nothing is uploaded to the cloud.
Automatic backups before an update
Each time a new version of VolNinja starts for the first time, it backs up your trading database before it changes anything. If an update ever goes wrong, the copy from just before it is waiting for you.
- On VolNinja Desktop, VolNinja keeps the two most recent automatic backups and removes older ones. Backups you take yourself are never removed automatically; they're yours to manage.
- On a Docker install,
volninja updatetakes the backup as one of its steps. See Updating VolNinja.
On VolNinja Desktop
Your backups live in the VolNinja window (menu bar / tray icon → Open Status). Expand More, then Backups. The row shows how many backups you have and how much space they take, or none.
Take a backup
Click Back Up Now. The same item is in the menu bar / tray menu, so you can take a backup without opening the window. Taking a backup doesn't stop anything; VolNinja keeps running while it copies.
Each backup in the list shows when it was taken and, beneath that, where it came from (this machine), the VolNinja version that made it, and its size.
Restore a backup
Click Restore on the backup you want. VolNinja asks you to confirm, then stops the engine, swaps in the backup, and starts the engine again. While it works, nothing is monitored and no automation runs, so restore when the market is closed.
If you hold open positions or working orders (or VolNinja can't tell, because the engine is down), the confirmation warns you and asks you to type RESTORE before it continues.
Warning
A restore rewinds your database, not Interactive Brokers. Your broker still holds whatever positions and orders it holds now. If the backup is from before you opened them, the restored database won't know about them and the two will disagree, and VolNinja's recovery may then act on the difference by placing orders. Reconcile or flatten at the broker before you restore.
Undo the last restore
After a restore, an Undo Last Restore card appears in the Backups section. It swaps back the database you were using right before the last restore.
Undo is the one action here you can't take back: the database in use now is discarded for good, along with everything recorded since that restore (trades, orders, positions). VolNinja always asks you to type UNDO to confirm, and shows the same broker warning as a restore.
Delete a backup
Click Delete on a backup and confirm. The backup is removed from your disk and can't be recovered. Deleting a backup never touches your live trading data.
On a Docker install
With a Docker install, you manage backups with the volninja command, in the same terminal you used to install it.
| Command | What it does |
|---|---|
volninja backup | Back up your trading database now. It prints the folder your backups are stored in. |
volninja backups | List your backups, with each one's size, where it came from, and the version that made it. |
volninja restore <name> | Restore the backup with that name (as volninja backups lists it). |
volninja restore --undo | Undo the last restore. |
Restoring works the way it does on the desktop app. VolNinja checks for open positions and working orders first: if you hold any, it shows the broker warning above and asks you to type RESTORE; otherwise it asks a plain yes/no. It then stops, swaps in the backup, brings the database up to the version you're running, and starts again. When it finishes it prints Restore complete, along with the undo command.
Undoing asks a yes/no question, then swaps the previous database back in, discarding the one in use now.
Warning
Your Docker backups are stored inside VolNinja's folder. volninja uninstall removes that folder, backups included, so copy any backup you want to keep somewhere else first. Run volninja open to find the folder.
If a restore fails, VolNinja tells you whether your database was left unchanged or may have been left part-way. In the second case, don't assume anything: check your positions before you resume trading, and contact support if you're unsure.
Good habits
- Back up before anything unusual, such as moving VolNinja to another database or another machine.
- Restore only when you're flat and the market is closed, after reconciling at the broker.
- Keep a copy elsewhere of any backup that matters to you. A backup on the same machine won't help if that machine is lost.
Related: Updating VolNinja · Installing & starting VolNinja · Advanced: Docker & VPS install