• Cheat sheets
  • Documentation
  • API reference
  • Product updates
  • Sign in
Kontent.ai Learn
  • Try Kontent.ai
  • Plan
  • Set up
  • Model
  • Develop
  • Create
Copyright © 2025 Kontent.ai. All rights reserved.
  • Web
  • Privacy policy
  • Cookies policy
  • Consent settings
  • Security
  • GDPR
  • Overview
  • Manage API keys
  • Hello World
  • Hello Web Spotlight
  • Try sample apps
  • Build apps
  • Decide navigation and URLs
  • Environments
    • What are environments?
    • Set up an environment
    • Environment tools
    • Sync environments
    • Migrate content
    • Backup, restore, and clean
    • Example
  • Get Developer Certification

Backup, restore, and clean environments

Carlo Vinci
5 minutes
Download PDF
0% complete
Sometimes, you need to start fresh, and other times, you need to protect what you’ve built. This lesson walks you through when and how to back up, restore, and clean your environments so you can stay in control.

Backup and restore your environment

Backups are useful before major changes, like restructuring your content model or preparing for a migration. They’re also helpful when you want to use an environment as a reusable template in other environments.

What to know before you start

The data-ops’s backup command uses the Management API, which means it only includes data accessible through that API. The command creates a structured ZIP file export of selected entities.  Similarly, the restore process recreates entities from the backup file, functioning more like a re-import than a true rollback. Best suited for:
  • Self-managed disaster recovery: Restore essential content, models, and assets into an empty environment to support manual recovery efforts and help rebuild the environment step by step.
  • Templating: Recreate an environment for templating or development purposes for consistency.
  • Archiving: Creating a structured export of content and models for long-term storage or compliance purposes.
Consider other alternatives for:
  • Full environment rollback: The restore process re-imports entities rather than reverting the environment to a previous state.
  • Regular backup cycles: These commands are designed for occasional use rather than ongoing, automated backups.
  • One-click recovery: Restoring from a backup is a manual, complex process that typically requires hands-on involvement and planning.
At Kontent.ai, we understand that your data is critical to your business. That’s why we’ve implemented additional disaster recovery measures in place.

Backing up environments 

To run the backup command, you’ll need an Environment ID and a Management API key. You can also customize the backup by including optional parameters.  While the command is running, you’ll see a detailed output showing the progress of the export, including any errors that may have occurred.  Once the command executes successfully, it generates a ZIP file containing all the configuration files required to restore the environment. Each ZIP file also includes a metadata.json file, which is useful for tracking and troubleshooting. The metadata.json file captures key details such as:
  • Environment ID
  • Timestamp of the export
  • Data-ops version
Backups typically cover all major data entities to restore the environment, but exclude the following:
  • The environment itself (only its contents are exported)
  • Roles and permissions
  • Role limitations to specific workflow steps
  • Asset types
  • API keys
  • Any entities you explicitly exclude using the exclude parameter

Restore to an empty environment

After backing up your environment, you can restore it to a clean environment using the restore command. This is perfect for starting new projects or reusing a template environment. You can also customize what gets restored using optional parameters. As the command runs, you’ll see a live summary that includes the import progress, entities being processed, and any errors that might come up along the way. It’s a great way to stay informed and quickly spot any issues. Once the restore is complete, you can discard the ZIP file or keep it for version control, historical tracking, auditing, or troubleshooting.

Get a fresh start with a clean environment

Removing outdated or unused content helps keep your environment clean, organized, and ready for the next phase of development or deployment. This is especially useful before restoring a backup or running a migration, where a clutter-free environment reduces the risk of conflicts and leftover content.Use the clean command to delete all entities from an environment, including content, assets, and settings. This command is ideal when you want to reuse an environment ID or reset a test environment, such as development. You can also selectively clean specific entities, such as content types, workflows, or webhooks, without affecting the rest. Check out the full list of parameters to see what is customizable.
Sign in with your Kontent.ai credentials or sign up for free to unlock the full lesson, track your progress, and access exclusive expert insights and tips!
Sign in
Backing up a long-lived environment or restoring an environment may take a while, depending on the amount of content you have. Start the process early or run during low-traffic hours.Additionally, consider rate-limiting policies. If you initiate a backup while your production environment is active, you may consume all available bandwidth. This can lead to degraded performance or request timeouts, potentially impacting production stability.
Alternative to backing up long-lived environmentsYou can back up your long-lived environment via cloning. Then, as you promote changes to production, you can also sync these changes incrementally to your backup environment over time. 
Before running the restore, it’s a good idea to review the contents of your backup and ensure they match what you want to deploy. This will help avoid surprises and ensure a smooth setup.
  • Backup and restore your environment
  • Backing up environments 
  • Restore to an empty environment
  • Get a fresh start with a clean environment