Schema Import & Export
Forge lets you synchronize your local customization files with a Protrak server, or with a portable .json file — without leaving VS Code. Run these from the Command Palette, or right-click a file or folder in the Explorer → Protrak Forge.
First: add a server connection
- Run Protrak Forge: Manage Server Connections and add your Protrak server (a name + URL).
- The first time you import or export against it, you'll be prompted for an access token. The token is cached securely in VS Code SecretStorage — never written to
settings.jsonor committed to source control. You can clear it anytime from Manage Server Connections.
Add as many connections as you like and pick which one to use each time. Keep a separate connection for each environment (Dev, QA, Staging, Production) or tenant — each stores its own URL and token, so you never re-enter credentials or risk pushing to the wrong server.
Import
- Import Schema from Server — pulls the schema from a running Protrak server into your project's
Types/,Lifecycles/,Attributes/, etc. - Import Schema File into Project — applies a previously exported
.jsonschema file to your project.
By default, import only adds and overwrites — it never deletes local files. To also remove local files no longer present in the incoming schema, enable the protrakForge.import.deleteMissingFiles setting (off by default; see Reference).
Export
- Export Local Schema to Server — pushes your local schema changes back to a server via the schema import API.
- Export Local Schema to File — serializes your local schema to a single
.jsonfile for review, archiving, or migration.
Scopes
Every import/export command works at one of three scopes. When you launch from the Explorer context menu, the scope is inferred from where you clicked:
| Scope | What it touches | Inferred when you right-click… |
|---|---|---|
| All | Every collection in the project | the project root |
| Collection | A single folder (e.g. Programs, Types) | a schema folder |
| Element | A single schema element (e.g. one Program) | a schema file (.json, or its .cs / .js / .html sidecar) |
Preview before it changes anything
Import and export show a dry-run summary before making changes — the files that will be written, and (only when deleteMissingFiles is enabled) the files that will be deleted. Nothing is written until you confirm.
A typical loop
- Import Schema from Server to pull the current schema into your project.
- Make your edits — by hand, or with your AI agent.
- Export Local Schema to Server to push them back — or Export Local Schema to File to produce a shareable
.json.
Forge's generation, validation, and "what's in my project" answers all read your local files. To work against what's actually deployed on a server, run Import Schema from Server first.