What Is Realm Export/Import in Keycloak?

What Is Realm Export/Import in Keycloak?

The complete, in-depth guide to capturing an entire Realm's configuration as a portable file, and bringing it back to life elsewhere.

Imagine a restaurant that’s spent years perfecting a single dish — the exact ratios, the exact plating, the exact cooking times — and now wants to open a second location. Nobody wants the new kitchen to rediscover the recipe by trial and error; they want the entire written recipe card, every ingredient and every step, handed over intact so the second location can reproduce the dish exactly. A Keycloak Realm, built up over months through careful configuration of Clients, Roles, Authentication Flows, Identity Providers, and every other concept covered elsewhere in this series, is exactly this kind of hard-won recipe. Realm Export/Import is Keycloak’s own built-in mechanism for writing that entire recipe down to a portable file, and reading it back in wherever it’s needed next.

This guide is a comprehensive, ground-up exploration of Realm Export and Import: what actually gets captured, the difference between a full and a partial export, the file format underneath it, the several distinct ways an administrator can trigger an export or import, what deliberately does not travel along with the file, and the real-world patterns organizations use to treat their Realm configuration as reproducible, version-controlled infrastructure rather than a fragile, hand-clicked one-off. No prior background with backups or configuration management is assumed — every term is explained in full the moment it first appears.

1Core Concepts

Before touching any specific export or import method, we need a precise, unambiguous definition of what these operations actually do.

What Is a Realm Export?

Export is the operation of writing out a Realm’s entire configuration — its Clients, Roles, Authentication Flows, Identity Providers, Groups, and (optionally) its Users — into a structured file, most commonly formatted as JSON, a widely used, human-readable text format for representing structured data. That file becomes a complete, self-contained snapshot of the Realm as it existed at the moment of export.

What Is a Realm Import?

Import is the reverse operation: reading a previously exported file back into a Keycloak server, recreating either a brand-new Realm from scratch, or updating pieces of an existing one, using the file’s contents as the source of truth for how that Realm should be configured.

i
Export/Import Is Not the Same as a Database Backup

It’s tempting to think of a Realm export as equivalent to backing up Keycloak’s underlying database, but the two are meaningfully different. A database backup captures everything, including internal implementation details specific to that exact database engine and version. A Realm export captures a portable, Keycloak-native representation of the configuration itself, deliberately designed to be readable and reusable across different Keycloak instances, database backends, and even certain version differences — a purpose-built configuration snapshot, not a raw data dump.

Why This Capability Exists

Manually recreating a Realm’s dozens of Clients, Roles, and carefully tuned Authentication Flows by clicking through the Admin Console every time a new environment is needed is slow, error-prone, and produces subtly different results each time a human repeats it by hand. Export/Import exists to make a Realm’s configuration something that can be captured once, reviewed, stored, and reliably reproduced — turning identity configuration into something closer to ordinary software, rather than a one-off manual artifact living only in one administrator’s memory of what they clicked.

2Architecture & Components

Realm Export/Import touches several distinct pieces of Keycloak’s own architecture. Let’s map the full picture before going deeper into any one of them.
graph TD
    DB["Keycloak's Underlying Database"]
    DB -->|"Export reads from"| Realm["Realm Configuration
(Clients, Roles, Flows, IdPs, Groups, Users)"] Realm -->|"Written to"| File["Portable JSON Export File"] File -->|"Import reads from"| Target["Target Keycloak Server
(same server, another environment, or a fresh install)"] Target -->|"Recreates or updates"| NewRealm["Realm Configuration on Target"]
Fig 2.1 — Export captures a Realm’s live configuration into a portable file; Import reads that file back into a target server
Source

Live Realm Configuration

The actual, currently running configuration inside a Keycloak server, built up through the Admin Console, the REST Admin API, or a prior import.

Snapshot

Export File

The portable JSON representation this guide focuses on, capturing everything needed to recreate the Realm elsewhere.

Scope

Full vs. Partial Export

Two distinct export modes, covered fully in Chapter 5, controlling exactly how much of the Realm’s data actually gets included.

Trigger

Export/Import Method

Several different ways to actually invoke export or import, covered fully in Chapters 6 through 8 — the Admin Console, the standalone command-line tool, and startup-time import.

3What Actually Gets Captured

A useful mental model of an export file is simply “everything an administrator could configure about this Realm through the Admin Console,” expressed as structured data instead of clicked settings.
CategoryIncluded in Export?
Realm-level settings (session timeouts, security defenses, tokens)Yes, always
Clients and their configurationYes, always
Realm Roles and Client RolesYes, always
Authentication Flows, including any Conditional FlowsYes, always
Identity Providers and their MappersYes, always
Groups and their Role assignmentsYes, always
UsersOnly with a full export, or a partial export with users explicitly included — covered in Chapter 5
Client secrets and Identity Provider credentialsIncluded, but deserve special handling — covered in Chapter 4
!
An Export File Is a Point-in-Time Snapshot, Not a Live Sync

An export file reflects the Realm exactly as it existed the moment the export ran. Any configuration change made afterward, in either the source or a previously imported target, isn’t automatically reflected anywhere else — keeping multiple environments aligned over time requires a deliberate, repeated export/import process, covered further in Chapter 11.

4Secrets, Credentials, and What Deserves Special Handling

Because an export file can contain genuinely sensitive material, this deserves its own dedicated discussion before going any further.

Client Secrets Are Included in Plain Text

A Confidential Client’s secret, covered elsewhere in this series’ guide to Client Authentication Methods, is written directly into the export file as plain, readable text. This means an export file is, functionally, a sensitive credential store in its own right, and needs to be handled with exactly the same care as any other file containing production secrets.

User Passwords Are Hashed, Not Reversible

When Users are included in an export, their passwords are exported in their already-hashed form — the same one-way, non-reversible representation Keycloak stores internally — rather than as plain text. This means an export doesn’t expose actual user passwords, though it’s still sensitive personal data deserving careful handling in its own right.

i
Treat Every Export File as a Secret

Because of the plain-text Client secrets described above, an export file should never be committed to a public or loosely access-controlled source-control repository, emailed casually, or stored somewhere without the same access restrictions applied to any other production credential material.

A Common Real-World Pattern: Export, Redact, Then Store

Many organizations address this by exporting, then deliberately stripping or replacing sensitive fields like Client secrets with placeholder values before the file is committed anywhere for version-controlled reuse, re-injecting real secrets separately at import time through an external secrets-management process rather than storing them inside the file itself.

Identity Provider Credentials Deserve the Same Treatment

Client secrets aren’t the only sensitive material an export can carry. Identity Brokering configuration, covered elsewhere in this series, often includes a client secret issued by the external Identity Provider itself, alongside whatever signing or encryption keys a SAML-based broker configuration might reference. Each of these deserves the exact same redaction discipline as a Client secret — a thorough security review of an export file checks every credential-shaped field, not only the most obvious one.

Production Example: A Templating Step in a CI/CD Pipeline

A mature deployment pipeline commonly runs an intermediate templating step between export and import, replacing every sensitive value with a placeholder token during export, and substituting genuine values back in — pulled from a dedicated secrets manager — immediately before the file is actually imported into its target environment. This keeps the file itself, at every point it might be stored or reviewed, entirely free of real credential material.

5Full Export vs. Partial Export

Keycloak offers two distinct export scopes, appropriate for genuinely different purposes.

Full Export

  • Captures the entire Realm, including every User account and their credentials
  • Produces a much larger file, scaling with the number of registered Users
  • Appropriate for genuine disaster-recovery backups, or migrating an entire Realm including its user base to a new server
  • Typically performed through the standalone command-line export tool, covered in Chapter 7, rather than the Admin Console

Partial Export

  • Captures the Realm’s configuration — Clients, Roles, Flows, Identity Providers, Groups — while excluding Users by default
  • Produces a much smaller, more manageable file focused on configuration rather than data
  • Appropriate for promoting configuration between environments, or checking configuration into version control
  • Available directly from the Admin Console’s own export screen, with checkboxes to optionally include Users and Groups

Production Example: Choosing Partial Export for Environment Promotion

A team promoting a Realm’s tested configuration from a staging environment into production typically uses a partial export, since production’s own user base is entirely separate from staging’s test accounts, and including staging’s test users in the file would risk polluting production with accounts that were never meant to exist there.

6Deep Dive: Exporting and Importing From the Admin Console

The most approachable, beginner-friendly way to perform an export or import, suited to occasional, manual use.

Exporting a Realm From the Admin Console

Inside a Realm’s own settings, an Export action produces a downloadable JSON file representing a partial export of that Realm’s current configuration, with optional checkboxes to include Groups and Users if a fuller snapshot is needed for this particular export.

Importing a Realm From the Admin Console

From the Realm selection screen, an administrator can choose to create a new Realm by directly uploading a previously exported JSON file, rather than configuring every setting by hand — Keycloak reads the file and recreates the entire Realm’s configuration from it in one operation.

Production Example: Quickly Cloning a Realm for Testing

A developer wanting to experiment with a risky Authentication Flow change without touching the actual working Realm can export it, import that same file back in under a new Realm name, and freely experiment on the clone — a fast, low-risk way to create a genuinely isolated sandbox that starts from an exact, known-good configuration.

i
Admin Console Import Creates a New Realm — It Doesn’t Merge Into an Existing One

Importing through the Admin Console’s Realm-creation screen always produces a new Realm from the file’s contents. Updating an already-existing Realm’s configuration from a file is a different operation, more commonly performed through the command-line tool or startup-time import, covered in the following chapters.

7Deep Dive: The Standalone Export/Import Tool

For a full export including every User, or for automated, scriptable operations, Keycloak provides a dedicated command-line capability separate from the Admin Console.

Why a Separate Tool Exists

A full export of a Realm with a very large number of Users can be a substantial operation, and running it through the same live server handling ordinary authentication traffic risks impacting performance for real users during the export. Keycloak’s standalone export/import tooling is designed to run this kind of full, potentially large-scale operation directly against the underlying data, independent of the ordinary running server process.

Scripting Repeatable Operations

Because this tooling is invoked from the command line rather than clicked through manually, it fits naturally into automated scripts and scheduled jobs — a nightly full-export job feeding into an organization’s broader backup process, for instance, running unattended without requiring an administrator to remember to click through the Admin Console every time.

Production Example: Scheduled Full Backups for Disaster Recovery

An organization with strict recovery-point requirements might schedule a full export to run automatically every night, storing each resulting file in a securely access-controlled backup location, ensuring that even a catastrophic failure of the live Keycloak deployment leaves no more than a single day’s worth of configuration and user changes actually at risk of being lost.

8Deep Dive: Startup-Time Import

A third distinct method, particularly well suited to automated, reproducible environment provisioning.

How It Works

Keycloak can be configured to automatically import one or more Realm files the moment the server itself starts up, rather than requiring any manual action after the server is already running. This is especially valuable in containerized deployments, where a fresh Keycloak container can come up already fully configured with its intended Realms, Clients, and Roles, entirely from files bundled alongside the deployment itself.

Everyday Analogy

Startup-time import is like a new appliance that comes pre-loaded with its factory settings the moment it’s plugged in, rather than requiring someone to manually configure every option after unboxing it. The “settings file” — the exported Realm JSON — travels with the appliance itself, so every unit built from the same file starts in an identical, known state.

Production Example: Reproducible Local Development Environments

A development team can bundle a partial export of their application’s expected Realm configuration directly alongside their project’s own source code, letting any new developer spin up a fully configured local Keycloak instance — matching the team’s actual Clients and Roles — with a single command, rather than manually reconstructing that configuration by hand from a wiki page or a colleague’s memory.

9Internal Working: What Happens During an Import

Let’s trace exactly what Keycloak does, step by step, once it begins processing an import file.
1

File Is Read and Parsed

Keycloak reads the provided JSON file and parses its structure, validating that it represents a well-formed Realm configuration before attempting anything further.

2

Target Realm Identified

Keycloak determines whether the import should create a brand-new Realm, or update an already-existing one with a matching name, depending on the specific import method and its own configured behavior.

3

Configuration Objects Recreated

Clients, Roles, Authentication Flows, Identity Providers, and Groups described in the file are created (or updated) inside the target Realm, in a dependency-aware order that respects, for instance, a Role referenced by a Group actually existing before that Group is created.

4

Users Recreated, if Included

If the file includes Users, their accounts, hashed credentials, and Role or Group assignments are recreated as well, completing the full picture of the target Realm.

5

Realm Becomes Active

Once import completes successfully, the resulting Realm is immediately available for use, exactly as if every setting inside it had been configured by hand through the Admin Console.

10Behavior When Importing Into an Already-Existing Realm

A particularly important nuance: what actually happens when an import targets a Realm name that already exists, rather than creating something brand new.

Merge Behavior, Not a Clean Overwrite

Importing into an already-existing Realm generally merges the file’s contents into what’s already there, rather than deleting everything first and starting fresh. Existing objects matching something described in the file are typically updated to match, while objects entirely unmentioned in the file are generally left untouched, though the precise behavior can vary depending on the specific import method and configuration used.

!
This Is Not a Reliable Way to “Reset” a Realm to Exactly Match a File

Because unmentioned objects are typically left alone rather than removed, importing a file into an existing Realm is not a dependable way to force that Realm back to exactly and only what the file describes — anything added to the Realm since the file was captured will generally still be there afterward. A genuine, clean reset to match a file exactly usually requires deleting the existing Realm first and importing into a fresh one.

Why This Matters for Ongoing Environment Synchronization

Teams relying on repeated imports to keep an environment’s configuration aligned with a version-controlled source file need to understand this merge behavior clearly — configuration drift introduced through manual Admin Console changes made directly against a target environment won’t automatically be corrected by a subsequent import, unless that drift happens to be explicitly overwritten by something the file itself also describes.

What Genuinely Gets Removed on Import

It’s worth being precise about the boundary here rather than treating merge behavior as an all-or-nothing rule. A field that exists in the file and already exists on the target is generally updated to match the file’s value exactly. An object entirely described by the file but that already exists on the target under the same identifier is generally replaced with the file’s version of it. What generally survives untouched is an object that exists on the target but has no corresponding entry in the file at all — a Client an administrator created directly against the target environment after the file was last captured, for instance, is a common example of something an import typically leaves alone rather than removing.

i
Verify Actual Behavior for Your Specific Version and Tooling

Because the precise merge semantics can vary somewhat between Keycloak versions and between the different import methods covered in this guide, a team building a process that depends on this behavior should verify the actual, current result directly against their own deployed version, rather than assuming it matches exactly what an older guide or a different team’s experience described.

11Data Flow & Lifecycle

A Realm’s configuration file moves through its own repeatable lifecycle, particularly for teams treating it as genuine infrastructure rather than a one-off snapshot.

Initial Configuration. A Realm is built up through the Admin Console, the REST Admin API, or an earlier import, reaching a state worth capturing and reusing.

Export. The Realm is exported, choosing full or partial scope depending on the intended purpose, as covered in Chapter 5.

Secret Handling. Sensitive fields are reviewed and, commonly, redacted or externalized before the file is stored anywhere long-lived, as covered in Chapter 4.

Storage. The resulting file is stored — in version control for configuration promoted between environments, or in a secured backup location for disaster-recovery purposes.

Import. The file is imported into its target — a fresh environment, a new Realm clone, or a startup-time provisioning process — recreating the captured configuration there.

Drift Management. Over time, the target environment may accumulate its own changes; a deliberate process for re-exporting and re-synchronizing keeps environments meaningfully aligned rather than silently diverging.

graph LR
    A["Realm Configured"] --> B["Exported
(Full or Partial)"] B --> C["Secrets Reviewed
& Redacted"] C --> D["Stored
(Version Control / Backup)"] D --> E["Imported Into Target"] E --> F["Ongoing Drift
Managed & Re-synced"] F --> B
Fig 11.1 — The lifecycle of a Realm export file, from initial capture through ongoing reuse and re-synchronization

12Advantages, Disadvantages & Trade-offs

Treating Realm configuration as an exportable, importable file brings real benefits, alongside genuine limitations worth understanding honestly.

Advantages

  • Turns Realm configuration into something reproducible and reviewable, rather than a fragile artifact living only in one administrator’s manual clicks
  • Enables reliable environment promotion — moving tested configuration from staging into production consistently
  • Supports genuine disaster-recovery backups through full exports capturing Users alongside configuration
  • Fits naturally into automated provisioning, including startup-time import for containerized deployments

Disadvantages & Trade-offs

  • Export files contain genuinely sensitive material — Client secrets in plain text — requiring the same careful handling as any other production credential
  • Import into an existing Realm merges rather than cleanly resets, which can be surprising if a true, exact reset was actually intended
  • A large full export, including every User, can be a substantial operation better suited to the standalone tooling than casual Admin Console use
  • An export file is a point-in-time snapshot; keeping it meaningfully synchronized with an evolving live Realm requires deliberate, ongoing process rather than a one-time effort

13Security

Because export files can carry genuinely sensitive material, mishandling them carries direct, real security consequences.
ADR-013: Committing an Unredacted Export File to a Shared Repository Anti-pattern Warning
Problem

A team wanting to version-control their Realm configuration exports it directly from the Admin Console and commits the resulting JSON file, unmodified, into a shared source-control repository readable by the entire engineering organization.

Why It Fails

As covered in Chapter 4, this file contains every Confidential Client’s secret in plain, readable text. Committing it unmodified exposes every one of those secrets to anyone with read access to the repository, and — because source-control history is typically permanent — simply deleting the file afterward doesn’t remove the exposure from the repository’s history.

Correct Approach

Redact or externalize sensitive fields before committing, following the pattern described in Chapter 4, and treat any export file that did contain real secrets as itself compromised, rotating those secrets, exactly as would be done for any other leaked credential.

Import as a Privileged Operation

Because an import can create Clients, assign Roles, and configure Identity Providers, the ability to perform an import is itself a highly privileged capability, deserving the same restriction and audit trail as any other administrative action covered elsewhere in this series’ discussion of Realm administration.

Validate Untrusted Import Files Before Use

An import file received from outside a fully trusted source — a vendor-provided template, for instance — deserves careful review before being imported, since a maliciously crafted file could introduce an unexpected Identity Provider, an unexpected administrative Role assignment, or other configuration a team wouldn’t have knowingly approved.

Production Example: A Malicious or Compromised Template File

Consider a scenario where a third-party vendor supplies a “starter Realm” template meant to speed up onboarding, but that file has been tampered with — perhaps quietly including an additional administrative Role assignment for an account the vendor controls, or an Identity Provider configured to trust an unexpected external authority. Because import applies the file’s contents largely as-is, a team that imports it without careful review could unknowingly grant standing administrative access to an outside party, discovered only much later during an unrelated security audit.

Least-Privilege Access to Export Files Themselves

Beyond who is allowed to perform an import, it’s worth separately restricting who can even read an already-produced export file, given the plain-text secrets it may contain, as covered in Chapter 4. Storage locations for these files — whether a version-control repository, a backup archive, or a shared drive — deserve access controls scoped as narrowly as the sensitivity of their contents actually warrants, rather than being left as broadly readable as an organization’s more routine, non-sensitive documentation.

14Monitoring, Logging & Metrics

Because export and import operations directly reshape a Realm’s configuration, they deserve the same operational visibility as any other significant infrastructure change.
Audit

Import Event Logging

Recording exactly when an import ran, who triggered it, and which Realm it targeted supports later review of how a given configuration state actually came to exist.

Verification

Post-Import Configuration Diffing

Comparing the target Realm’s resulting configuration against the source file after an import helps catch any unexpected merge-related surprise, as discussed in Chapter 10.

Backup Health

Scheduled Export Success Tracking

For a nightly backup process built on full exports, monitoring that each scheduled export actually completed successfully is essential — a silently failing backup job provides no real protection at all.

Drift Detection

Environment Comparison Over Time

Periodically re-exporting a live environment and comparing it against the version-controlled source file that originally provisioned it reveals how much manual drift has accumulated since the last synchronized import.

15Design Patterns & Anti-patterns

A handful of consistent habits separate a genuinely reliable export/import workflow from a fragile, error-prone one.

Good Patterns

  • Use partial exports for configuration promotion between environments, and full exports specifically for genuine disaster-recovery backups
  • Redact or externalize secrets before storing any export file long-term or in version control
  • Use startup-time import for reproducible environment provisioning, particularly in containerized deployments
  • Understand merge behavior explicitly before relying on import to synchronize an already-existing environment, verifying the actual resulting state rather than assuming a clean reset occurred

Anti-patterns to Avoid

Common Mistakes

  • Committing an unredacted export file containing plain-text Client secrets to a shared repository, as covered in Chapter 13
  • Assuming an import into an existing Realm cleanly resets it to exactly match the file, when it actually merges
  • Running a large full export against a live, production-traffic-handling server rather than using the standalone tooling designed for it
  • Never re-exporting after manual changes, leaving the version-controlled source file silently out of date with reality

16Real-World & Industry Examples

Export and Import quietly underpin a wide range of real Keycloak deployment practices.

Continuous Integration Pipelines

A software team’s automated pipeline commonly spins up a fresh Keycloak container using startup-time import of a version-controlled partial export, giving every automated test run an identical, known-good identity configuration without any manual setup step.

Multi-Environment Promotion

An organization maintaining separate development, staging, and production Realms typically exports configuration from a lower environment once it’s been tested and approved, then imports that same file into the next environment up, ensuring consistent configuration travels deliberately through each stage rather than being manually re-created at every step.

Disaster Recovery Planning

A regulated organization with strict recovery-time requirements typically maintains a scheduled full-export backup process, storing each resulting file in a securely access-controlled, geographically separate location, ensuring a catastrophic failure of the live deployment can be recovered from a recent, complete snapshot.

Vendor and Partner Onboarding Templates

A platform onboarding many similar partner organizations might maintain a partial export representing a standard “starter” Realm configuration, importing a fresh copy for each new partner rather than manually reconfiguring the same set of Clients and Roles by hand every time.

Migrating Between Self-Hosted and Managed Deployments

An organization moving from a self-managed Keycloak cluster to a managed hosting offering, or between two entirely different infrastructure providers, commonly leans on a full export as the actual migration vehicle — capturing the complete Realm, including its Users, from the old environment and importing it directly into the new one, avoiding a slow, error-prone manual reconstruction of years of accumulated configuration.

17Frequently Asked Questions

Q1Is a Realm export the same thing as a database backup?
No — a database backup captures raw, engine-specific data, while a Realm export produces a portable, Keycloak-native configuration snapshot, deliberately designed to be reusable across different servers and, to a degree, different Keycloak versions.
Q2Are Users included in an export by default?
Not in a partial export from the Admin Console, which focuses on configuration by default — Users are included only in a full export, or a partial export with the Users option explicitly checked.
Q3Are Client secrets safe inside an export file?
No — they’re written in plain, readable text. An export file should be handled with the same care as any other file containing production credentials, and ideally redacted before long-term storage or version control.
Q4Does importing into an existing Realm delete anything not mentioned in the file?
Generally no — import into an existing Realm typically merges the file’s contents rather than performing a clean reset, so objects not described in the file are usually left untouched rather than removed.
Q5What’s the best way to provision a fresh, reproducible environment automatically?
Startup-time import, which lets a Keycloak server automatically import one or more Realm files the moment it starts, particularly well suited to containerized deployments and continuous integration pipelines.
Q6Why would I use the standalone command-line tool instead of the Admin Console?
Primarily for a full export including a large number of Users, since running that as a substantial operation against a live, traffic-serving server risks performance impact — the standalone tooling is designed to handle this kind of larger-scale operation separately.
Q7Can I use export/import to clone a Realm for testing?
Yes — exporting an existing Realm and importing that same file back in under a new Realm name is a fast, reliable way to create an isolated copy for experimentation, starting from an exact, known-good configuration.
Q8Is an export file safe to review to understand a Realm’s configuration?
Yes, and this is a genuinely useful side benefit — a well-organized export file gives a human-readable, complete picture of a Realm’s configuration, though anyone reviewing it should still treat any visible secrets with appropriate care rather than sharing the file casually.
Q9What happens to Identity Provider credentials during export?
They’re included in plain text, just like Client secrets, and deserve exactly the same redaction discipline before an export file is stored long-term or committed to version control — a thorough review checks every credential-shaped field, not only the most obvious ones.
Q10If I import a file into a Realm that already has extra Clients not in the file, will those be deleted?
Generally no — objects that exist on the target but have no corresponding entry in the file are typically left untouched by an import. Exact behavior can vary somewhat by version and method, so it’s worth verifying directly against your own deployment before relying on it.
Q11Can export/import replace a proper disaster-recovery database backup entirely?
Not on its own — a scheduled full export is a strong complement to a broader disaster-recovery strategy, but it’s still worth maintaining alongside, rather than instead of, whatever database-level backup process already protects the underlying infrastructure Keycloak itself runs on.

18Summary and Key Takeaways

“An export file is the written recipe — import is what lets any kitchen reproduce the dish exactly.”

Key Takeaways

  • Export writes a Realm’s entire configuration to a portable JSON file; Import reads that file back in, recreating or updating a Realm from it.
  • A full export includes Users and is suited to disaster-recovery backups; a partial export focuses on configuration and is better suited to environment promotion and version control.
  • Export files can be triggered three main ways: the Admin Console for occasional manual use, the standalone command-line tool for large-scale or scripted operations, and startup-time import for automated, reproducible provisioning.
  • Export files contain Client secrets in plain text — treat them exactly like any other production credential, redacting or externalizing sensitive fields before long-term storage.
  • Importing into an already-existing Realm merges rather than cleanly resetting it — objects not described in the file are typically left untouched.
  • Treating Realm configuration as a version-controlled, exportable/importable artifact turns identity infrastructure into something reproducible and reviewable, rather than a fragile, manually clicked one-off.
  • Restrict both who can perform an import and who can even read a stored export file, given the plain-text credentials it may carry, and validate any file received from outside a fully trusted source before importing it.