NinjaTrader Maintenance: Clear the Cache, Reset DB vs Repair DB, Safe Mode and Log Files

Each NinjaTrader maintenance tool deletes something different. Clearing the cache and reloading historical data only touch stored chart data, which downloads again from your provider. Reset DB removes your historical orders and executions but keeps chart data, simulation accounts and workspaces. Repair DB is for when NinjaTrader support tells you to run it, and Safe Mode deletes nothing at all.
Menu names below are for NinjaTrader 8.1.x.x (checked against NinjaTrader’s help guide and a NinjaTrader 8.1.8.3 install, October 2026). Before 8.1.5, Tools › Settings was called Tools › Options.
What each tool fixes, deletes and keeps
| Tool | Fixes | Deletes | Keeps | Use it when |
|---|---|---|---|---|
| Reload All Historical Data | Gaps after a connection drop; bars built from live data that differ from the provider’s history | Locally stored data for that instrument’s base interval, overwritten by a fresh download | Everything else | One instrument’s chart looks wrong. Try this first. |
| Clear the cache | Slow chart loading; bad bars or gaps a reload did not fix | Cached chart data (plus stored tick, minute and day data if you delete those folders too) | Trade history, accounts, workspaces, templates, settings, add-ons | A reload did not fix the data, or charts take a long time to load |
| Reset DB | Stuck or frozen orders | Historical orders, historical executions, or both (you choose) | Chart data, simulation accounts, workspaces, templates, settings | Old orders stay stuck in the Orders tab |
| Repair DB | Database problems NinjaTrader support has diagnosed | Not documented by NinjaTrader. Back up first. | Not documented by NinjaTrader | Only when NinjaTrader support directs you |
| Restore Workspace | A workspace that opens blank, charts that fail to load, a layout saved wrong | Nothing. You go back to an older saved version of one workspace, so changes saved after it are not included. | Everything else | One workspace broke after a crash or a bad save |
| Safe Mode | Nothing by itself. It shows whether an add-on or workspace causes the problem. | Nothing | Everything | Crashes, freezes or errors you cannot pin down, or support asks |
| Clean reinstall | Problems that continue even in Safe Mode | The program files only | Workspaces, strategies, templates, database, logs and trace files in Documents\NinjaTrader 8 |
Last resort, ideally with NinjaTrader support |
One common mix-up: Update Instruments, in the same Database Management window, is not a database reset. It replaces your instrument definitions with NinjaTrader’s current server versions. NinjaTrader suggests it for a failed contract rollover or a chart that is not updating despite a live data subscription. It does not touch your orders, executions or chart data.
Back up first
A backup takes a few minutes and makes every step below reversible.
- Disconnect from all connections in the Connections menu of the Control Center. NinjaTrader asks you to close all account connections before it exports a backup.
- In the Control Center, go to Tools › Export › Backup File…
- In the Export Backup File window, tick what to include: Workspaces, Templates, NinjaScript files, Configuration files and Database (Historical trade data) cover most setups. Historical chart data and Market replay make the file much larger.
- Click Export, confirm the name and location, and save. The default folder is
Documents\NinjaTrader 8 Backup, with the date in the file name.
NinjaTrader recommends keeping two backups: one with the database and NinjaScript files, and one without. Copy them off the PC too. To restore, use Tools › Import › Backup File… and pick the parts you want. The import overwrites existing files in the categories you select.
Reload All Historical Data
This is the gentlest fix for wrong bars or gaps on a chart.
- Connect to a data provider that supplies historical data.
- Right-click the chart and choose Reload All Historical Data. Some NinjaTrader support pages shorten the name to Reload Historical Data.
- Wait for the loading indicator in the top-left of the chart to finish.
It reloads the base interval (minute data for a 5-minute chart, for example) for every chart of that instrument, and it overwrites the locally stored cache and repository data for it. If a strategy is running on that instrument, NinjaTrader asks before it stops and restarts the strategy. You can also give this command a key under Tools › Hot Keys, where it is listed as Reload all historical data.
Clear the NinjaTrader cache
Use this when a reload did not fix the data, or when charts and workspaces have become slow to load because the cache has grown large.
- Close NinjaTrader completely.
- Open File Explorer (Windows key + E) and go to
Documents\NinjaTrader 8\db. - Delete the
cachefolder. For a full refresh of stored chart data, NinjaTrader’s own support article also deletes thetick,minuteanddayfolders. - Start NinjaTrader and connect. Charts may take longer to load the first time while the data downloads again.
Do not delete or move anything else in that folder. It also holds NinjaTrader’s database file (NinjaTrader.sqlite), which stores your trade history and instrument definitions, and your Market Replay data. One more caution: if you imported data, or recorded more history than your provider keeps, the tick, minute and day folders may hold data you cannot download again. Back it up first by including Historical chart data in a backup.
If OneDrive backs up your Documents folder, the path starts with OneDrive\Documents instead. That sync is a known cause of missing and reverting files; see resolving NinjaTrader issues with OneDrive.
Reset DB: clear historical orders and executions
- Back up, including Database (Historical trade data).
- Disconnect from all connections. NinjaTrader refuses to reset the database while connected.
- In the Control Center, go to Tools › Database Management.
- In the Reset DB section, tick Historical orders, Historical executions, or both.
- Click Reset and confirm.
- If NinjaTrader says a restart is required, restart it before you reconnect.
What it deletes: the historical orders and executions you ticked. NinjaTrader’s confirmation warns that removing executions also clears the strategy data tied to them, and executions are the history that performance reports are built from. What it keeps: chart data, simulation account balances, workspaces, templates and settings. To clear only stuck orders and keep your performance history, tick Historical orders alone. Our help page on resetting frozen orders in NinjaTrader also covers resetting a simulation account.
Repair DB: only when NinjaTrader support directs you
NinjaTrader’s help guide and the Database Management window itself say the same thing: use Repair DB only when NinjaTrader support tells you to. If they do:
- Back up first, including the database.
- Disconnect from all connections. Repair does not run while you are connected.
- Go to Tools › Database Management, find Repair DB and click Repair.
- Wait. On a large database it can take a few moments.
Restore a workspace from a recovery version
- Go to Tools › Database Management.
- In Restore workspace, click Restore. A file window opens in
Documents\NinjaTrader 8\workspaces\recovery, with one folder per workspace name. - Double-click the folder for your workspace and choose the version with the date and time you want.
NinjaTrader keeps 10 versions by default. You can change that under Tools › Settings › General with Versions of recovery workspaces. Restore cannot bring back a workspace you deleted; only a backup can.
Start NinjaTrader in Safe Mode
Safe Mode starts NinjaTrader without loading workspaces, without connecting on startup, without custom assemblies and add-ons, and without instrument updates from the server. Two ways to start it:
- Close NinjaTrader. Press the Windows key, search for NinjaTrader and choose NinjaTrader (Safe Mode).
- Or close NinjaTrader, hold Ctrl, double-click the NinjaTrader icon, and keep holding Ctrl until the login screen appears.
To confirm it worked, open Help › About. “Safe Mode” appears next to the version number. Then test:
- Connect manually from the Connections menu.
- Open a new chart without custom bar types, indicators or templates, and look for the problem.
- If the new chart is fine, open your own workspace and keep testing. If it opens but shows no windows, close it from the Workspaces menu without saving, then open it again.
Do not save your workspace while in Safe Mode. Add-ons are not loaded, so saving can overwrite your real setup. If the problem is gone in Safe Mode, an add-on or your workspace is the likely cause: rebuild the workspace one piece at a time and contact the add-on’s vendor. If the problem continues in Safe Mode, contact NinjaTrader support. To leave Safe Mode, close NinjaTrader without saving and start it the normal way.
Where the log and trace files are, and how to send them
NinjaTrader writes diagnostic files to two folders:
Documents\NinjaTrader 8\logDocuments\NinjaTrader 8\trace
To send them from inside NinjaTrader:
- In the Control Center, go to Help › Message Support. NinjaTrader’s help guide still calls this item Email Support.
- Choose the category of your request and enter the email address on your NinjaTrader account.
- Describe the problem. If you are already working with a support agent, type “Agent” with your case number or the agent’s name.
- Make sure Log and trace files is checked (it is on by default), then send.
To send them by hand instead, close NinjaTrader, open Documents\NinjaTrader 8, right-click the log folder and choose Compress to › ZIP File, do the same for trace, and attach both ZIP files to your reply.
Clean reinstall (last resort)
- Back up, then close NinjaTrader.
- Open Windows Settings › Apps › Installed apps, find NinjaTrader, and choose Uninstall. Restart if Windows asks.
- Sign in to your NinjaTrader Dashboard, click Download, and install the latest release.
Uninstalling does not delete Documents\NinjaTrader 8, so your workspaces, strategies, templates, database, logs and trace files are still there afterward. That also means a reinstall does not reset anything stored in that folder. If support decides you need a fresh user folder as well, let them walk you through it.
Frequently asked questions
Do I delete everything in the NinjaTrader 8\db folder?
No. Delete the cache folder, and tick, minute and day only if you want all stored chart data downloaded again. NinjaTrader’s support article says not to delete or move any other folders there, because the same folder holds your database file and Market Replay data.
Does resetting my DB mean I lose all my workspaces?
No. Reset DB only removes the historical orders and executions you tick. Workspaces are files in Documents\NinjaTrader 8\workspaces, not database records, and chart data and simulation accounts stay too.
I tried Reset DB and it still reverts.
Reset DB cannot fix a layout or setting that keeps reverting, because it only touches order and execution history. Workspaces do not save themselves: use Workspaces › Save or Shift+F4 after changes. If files still go back to old versions, check whether OneDrive is syncing your Documents folder.
I reset the DB but the ghost orders come back.
Make sure you were disconnected and restarted NinjaTrader if it asked. On a simulation account, reset the account itself from the Accounts tab (Edit Account…, then Reset with Clear history checked). On a live account, a database reset cannot cancel anything at your broker, so if an order returns every time you connect, contact your broker or NinjaTrader support before trading.
NinjaTrader support told me to restart in Safe Mode. How?
Close NinjaTrader, then pick NinjaTrader (Safe Mode) from the Windows Start menu, or hold Ctrl while you double-click the NinjaTrader icon until the login screen appears. Help › About shows “Safe Mode” next to the version when it worked.
Where are the NinjaTrader log files?
In Documents\NinjaTrader 8\log, and the trace files are in Documents\NinjaTrader 8\trace. The easiest way to send both is Help › Message Support with Log and trace files checked.
If your real problem is speed rather than broken data, start with NinjaTrader slow or lagging or NinjaTrader freezing or not responding, and check whether you should update NinjaTrader before reinstalling anything.