Backup, restore, and clean environments
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- 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.
- 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.
Backing up environments
To run thebackup
command, you’ll need an Environment ID and a Management API key. You can also customize the backup by including optional parameters- Environment ID
- Timestamp of the export
- Data-ops version
- 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 therestore
command. This is perfect for starting new projects or reusing a template environment. You can also customize what gets restored using optional parametersGet 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
to see what is customizable.
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