Version Control
Track every change to a RodSim simulation. PetroBench saves a snapshot every time you run, restore, duplicate, or import. Compare versions, restore previous states, and clean up old ones.
Version history is available on the Enterprise package only.
Every RodSim simulation has a built-in version history. PetroBench saves a snapshot whenever something significant happens (a run, a duplicate, an import) and each version is fully restorable.
How Versions Get Created
PetroBench creates a version automatically. Two categories, seven triggers.
| Category | Trigger | When it fires |
|---|---|---|
| Base Case | Create | First time the simulation is created |
| Import | Imported from a RodStar or SRod file | |
| Sync | Data bridge synced from an external system | |
| Auto | Run | After a static or dynamic simulation finishes |
| Duplicate | When you duplicate the simulation | |
| Restore | When you restore a previous version | |
| Migration | System migrated the simulation schema |
Base Case versions mark the original state of the simulation. Auto versions cap and get cleaned up over time.
1. Open Version History
- Open the simulation
- Click the Version History icon in the top-right toolbar
- The history sheet slides in from the right
Each version shows:
- Version number (v1, v2, ...)
- Trigger badge (Simulation Run, Duplicated, Restore)
- Date and time, who triggered it
- Inline diff of what changed since the previous version (e.g. 17 changes since v2) with red strikethroughs and green new values
- Add note button to label the version
- Restore button (on every version except the current one)
- Current green tag on the latest version
2. Add a Note
Notes turn an auto-generated version into a labeled one, which protects it from cleanup and makes it findable later.
- Click Add note under any version
- Type the label (for example, "Version 3 Note" or "Before rod redesign")
- Click the green check to save
To change a label later, hover the version and click Edit note.
Add a note to any version you want to keep around. Cleanup never touches a labeled version.
3. Compare Versions
Two flows.
3.1 Compare a Version Against Current
Default flow when you have one version selected (or zero, in which case it picks the most recent).
- Open the history sheet
- Click Compare with current at the bottom
The Compare view shows two columns side-by-side. The tab strip across the top groups changes by section with counts:
| Tab | Shows |
|---|---|
| All | Every changed field across the simulation |
| Simulation Preferences | Targets, damping, step length |
| Well Data | Fluid properties, pump specs, pumping unit |
| Tubing Data | PSN depth, anchor, tubing string |
| Rod Data | Rod taper string |
| IPR Data | Reservoir test data |
The toggle in the top-right (Changes only) hides identical fields so you only see what differs.
3.2 Compare Two Versions
- In the history sheet, tick the checkboxes on two versions
- Click Compare with current (the button label shifts to compare the two)
The diff layout is the same. Use the chevron arrows in the top-right of the Compare view to step through versions without leaving the page.
4. Restore a Version
From the Compare view, click the Restore to v[N] button in the bottom-right. From the history list, click Restore on any version.
The dialog confirms:
Restore to v2? This will revert the simulation to the selected version. A backup of the current state will be saved automatically before restoring.
Click Restore. PetroBench:
- Saves the current state as a new version (so the rollback itself is reversible)
- Replaces the simulation inputs with the snapshot
- Adds a new version with trigger Restore and a "Restored from v[N]" label
You cannot restore while a dynamic simulation is currently running. Wait for it to finish.
If a restore is blocked, the sheet shows "This version cannot be restored" with the reason.
5. Cleanup Old Versions
Cleanup is restricted to Admin app roles. Engineers can create and restore versions but cannot delete them.
Auto Run versions can pile up fast. Use Cleanup to thin them out without losing the ones you care about.
- In the history sheet, click Cleanup
- Pick a scope:
| Option | What gets deleted |
|---|---|
| Delete all old versions | Every unlabeled auto version except the most recent |
| Older than 7 days | Auto versions older than 7 days |
| Older than 30 days | Auto versions older than 30 days |
| Older than 90 days | Auto versions older than 90 days |
The popup tells you exactly how many will be removed: "2 unlabeled version(s) eligible for cleanup. Labeled versions and the latest version are always preserved."
The Filter by trigger selector at the top of the same popup lets you narrow the scope to specific trigger types (only Run, only Duplicate, etc.) before running cleanup.
Permissions
Version actions check role permissions:
| Action | Required permission |
|---|---|
| View history | View simulation |
| Compare | View simulation |
| Edit note | Edit simulation |
| Restore | Edit simulation |
| Delete / Cleanup | Admin role only |
If you don't have permission for an action, the button stays visible but disabled with a tooltip explaining why.