Settings Migration
AgentSettingsRepository.load() stamps the Burp preferences store with a schema version and runs forward-only migrations before loading settings. This page explains the model and shows how to add a new migration step.
Schema Version Field
The schema version is stored in Burp preferences under the key settings.schema.version as an integer. AgentSettingsRepository.CURRENT_SETTINGS_SCHEMA_VERSION is the authoritative internal target; loads treat an absent value as v1.
Current Schema
v1
Baseline — all original settings keys.
v2
Normalize mcp.allowedOrigins into a clean list; replace the legacy Gemini default command with --output-format text --model gemini-2.5-flash --yolo. Introduces MCP proxy history preprocessing keys (preprocess.proxy.history.*) with defaults.
v3
Stamp only — no data movement. Reserves the custom.prompt.library.v1 key for the Custom Prompt Library; missing or malformed JSON loads as an empty library.
v4
Encrypt eight existing plaintext secret preferences in place with SecretCipher: the Ollama, LM Studio, OpenAI-compatible, NVIDIA NIM, Perplexity, and Anthropic API keys, plus the MCP token and TLS password. Values already prefixed ENC1: and blank values are skipped; plaintext is overwritten only after decrypting the new ciphertext back to the exact original value.
v5
Reserve the encrypted external-MCP-server blob. Existing installs load an empty server list; no old field is moved because the key is new.
Migration Flow
Guarantees:
Migrations are forward-only. Most versions add defaults; v4 deliberately replaces plaintext secret values after a verified encryption round trip.
Migrations are idempotent at their field boundary. Re-running the chain on already-v5 preferences is a no-op, and the v4
ENC1:guard prevents double encryption.A missing new key means "use the default" unless the migration explicitly owns old data that must be transformed.
Migrations never read UI state. They operate only on the preferences snapshot.
Adding a New Migration Step
Bump
CURRENT_SETTINGS_SCHEMA_VERSIONby 1 (for example, from5to6).Add a new private helper in
AgentSettingsRepository:Call it from
migrateIfNeeded(), guarded byif (effectiveVersion < 6), then seteffectiveVersion = 6. Keep all earlier guards intact so users on v1 still run every step in order.Let the chain stamp
KEY_SETTINGS_SCHEMA_VERSIONafter walking the version guards. Do not write the marker inside the helper.Add cases to
AgentSettingsMigrationTestor the feature-specific migration test (for exampleExternalMcpSettingsMigrationTest) that start from older versions and assert the final shape.
The version guard decides whether a migration step runs. Inside a step, field-level presence checks and idempotency markers are expected—for example, v4 skips blank or already-ENC1: values. Tests should cover the oldest supported source version, immediate predecessor, already-current state, partial data, and a second load.
Downgrade Policy
Downgrades are not supported. Schema v4 is particularly important: older builds do not understand the ENC1: secret representation, and v5 adds a settings blob unknown to them. If a user must roll back:
Close Burp.
Restore a complete preferences or project backup created by the older version, or reset the extension's preferences and re-enter settings in the older build.
Reopen Burp with the older JAR and verify backend/MCP credentials before use.
Changing only settings.schema.version is not a rollback: it neither decrypts v4 secrets nor converts newer data shapes. Back up the Burp project/preferences before testing migration changes.
Related Pages
Last updated
