Skip to main content

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

  1. Run Protrak Forge: Manage Server Connections and add your Protrak server (a name + URL).
  2. 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.json or committed to source control. You can clear it anytime from Manage Server Connections.
One connection per target

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 .json schema 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 .json file 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:

ScopeWhat it touchesInferred when you right-click…
AllEvery collection in the projectthe project root
CollectionA single folder (e.g. Programs, Types)a schema folder
ElementA 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

  1. Import Schema from Server to pull the current schema into your project.
  2. Make your edits — by hand, or with your AI agent.
  3. Export Local Schema to Server to push them back — or Export Local Schema to File to produce a shareable .json.
Working against what's deployed

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.