Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Campaign Archive Format

Technical reference for Mimir’s campaign export/import archive format.

Overview

Campaign archives are gzip-compressed tar files with the extension .mimir-campaign.tar.gz. An archive contains a complete snapshot of one campaign — metadata, modules, documents, characters, maps, tokens, homebrew content, and binary assets. Archives are self-contained and portable between machines and Mimir installations.

PropertyValue
Format identifiermimir-campaign
Format version2.0
File extension.mimir-campaign.tar.gz
Export filename<campaign-name-slug>.mimir-campaign.tar.gz (lowercased, non-alphanumeric characters replaced with hyphens; consecutive separators collapsed to a single hyphen; leading and trailing hyphens stripped)

Archive Structure

<slug>.mimir-campaign.tar.gz
├── manifest.json                    # Archive metadata
├── data.json                        # All campaign data
└── assets/
    └── {asset-id}/{filename}        # One file per campaign asset

The archive contains exactly two JSON files plus one entry per asset. Asset files are stored under their original asset ID and filename; binary content is not hashed or deduplicated.

Manifest

manifest.json contains archive metadata:

FieldTypeDescription
versionstringArchive format version ("2.0")
formatstringFormat identifier ("mimir-campaign")
created_atstringISO 8601 export timestamp (UTC)
campaign_namestringCampaign name at export time
mimir_versionstringMimir version that created the archive
countsobjectEntity counts (see below)
catalog_referencesarrayCatalog items referenced by campaign documents

Counts

FieldType
modulesnumber
documentsnumber
charactersnumber
mapsnumber
tokensnumber
module_monstersnumber
module_npcsnumber
assetsnumber
homebrew_itemsnumber
homebrew_monstersnumber
homebrew_spellsnumber

Catalog References

Each entry identifies a catalog item that campaign documents reference but the archive does not contain:

FieldTypeDescription
typestringReference type: monster, spell, item, creature, condition, feat, race, class, or background
namestringItem name
sourcestringSource book code

References are extracted at export time by scanning document content for {@type name|source} tags.

Campaign Data

data.json contains all campaign entities in a single JSON object:

FieldTypeDescription
campaignobjectCampaign record
sourcesstring[]Enabled source book codes
modulesarrayModule records
documentsarrayDocument records (full text content)
charactersarrayCharacters with related data (see below)
mapsarrayMaps with related data (see below)
tokensarrayToken placements across all maps
module_monstersarrayMonster references attached to modules
module_npcsarrayNPCs attached to modules
assetsarrayAsset records (filename, MIME type, blob path)
homebrew_itemsarrayCampaign homebrew items
homebrew_monstersarrayCampaign homebrew monsters
homebrew_spellsarrayCampaign homebrew spells

Character Entries

Each character entry contains the base character fields (flattened) plus:

FieldContents
classesClass entries (levels, subclasses, starting-class flag)
inventoryInventory items
spellsKnown spells
proficienciesProficiency entries
featuresClass features
featsFeats

Map Entries

Each map entry contains the base map fields (flattened) plus:

FieldContents
poisPoints of interest
trapsTrap placements
light_sourcesLight source definitions
fog_areasFog of war revealed areas

Asset Files

Binary files (map images, token art) are stored in the archive at assets/{asset-id}/{filename}, where {asset-id} is the asset’s UUID at export time and {filename} is its original filename.

Import Behavior

When an archive is imported:

  1. The archive is extracted and data.json is parsed; import fails if data.json is missing or unparseable. The manifest’s format field is not checked during import — that validation happens only in archive preview (see Preview)
  2. New UUIDs are generated for all entities, so imports never conflict with existing data
  3. Internal references (module, document, character, map, asset, and monster/NPC IDs) are remapped to the new UUIDs
  4. Asset files are copied into the importing installation’s assets directory under campaigns/{new-campaign-id}/{filename}
  5. Campaign sources are restored; they take effect only if the corresponding catalog data exists in the importing installation
  6. If the campaign name already exists, a numeric suffix is appended (e.g., Name (2)), unless a name override is supplied

Importing the same archive twice creates two independent copies of the campaign.

Preview

An archive preview reads manifest.json without extracting or importing the rest of the archive. Preview is where the manifest’s format field is validated: archives whose format is not "mimir-campaign" are rejected. The preview contains:

FieldDescription
campaign_nameFrom manifest
countsEntity counts from manifest
catalog_referencesCatalog items the campaign references
mimir_versionMimir version that created the archive
created_atExport timestamp
archive_versionArchive format version

See Also