Skip to main content

Exporting Customizations in Frappe Framework v15

Introduction & Context

Customizations are at the heart of every ERPNext implementation. From Custom Fields and Property Setters to workflow tweaks, real-world ERP deployments rarely remain vanilla.

In Frappe Framework v15, exporting customizations is the recommended and production-safe way to migrate configuration changes across environments—without copying databases or writing migration scripts.
This guide explains how exporting customizations works, when to use it, and how to implement it correctly in Frappe v15 using fixtures.

What Does “Exporting Customizations” Mean in Frappe?

Exporting customizations means converting UI-level configuration changes into version-controlled JSON files that live inside a Frappe app.
These exported files can then be:

  • Installed on another site
  • Migrated between environments (Dev → UAT → Prod)
  • Tracked in Git
  • Reapplied automatically during app installation

This process ensures repeatable, auditable, and safe deployments.

Why Export Customizations Instead of Copying a Database?

Exporting customizations is preferred because it:

  • Avoids environment-specific data conflicts
  • Works cleanly with CI/CD pipelines
  • Supports multi-site deployments
  • Aligns with Frappe’s app-first architecture

Database copying is risky and often breaks site-specific settings.

What Types of Customizations Can Be Exported?

Frappe v15 supports exporting the following via fixtures:

  • Custom Field
  • Property Setter
  • Custom DocType
  • Client Script
  • Server Script
  • Workflow
  • Role Permission Manager entries

Only configuration, not transactional data, is exported.

How Exporting Customizations Works Internally

Frappe uses a mechanism called fixtures.

Fixtures are:

  • JSON files
  • Stored inside your app
  • Automatically loaded during bench migrate or app installation

They represent DocType records that should always exist in a site.

Configuration & Setup: Enabling Export via Fixtures

Where Are Fixtures Defined?

Fixtures are defined inside your app’s:

hooks.py

This tells Frappe which DocTypes should be exported.

Basic Fixture Configuration Example

fixtures = [
"Custom Field",
"Property Setter"
]

This configuration ensures all Custom Fields and Property Setters are exported.

Implementation Details: Exporting the Customizations

Step-by-Step: How to Export Customizations

Answer:
Customizations are exported using the export-fixtures command.

Step 1: Navigate to Bench Directory

cd frappe-bench

Step 2: Run Export Command

bench export-fixtures

This command scans the configured DocTypes and writes JSON files to:

apps/your_app/your_app/fixtures/

What Gets Generated After Export?

After exporting, you’ll see files like:

custom_field.json
property_setter.json

Each file contains structured JSON records representing your UI changes.

How Fixtures Are Applied on Another Site

When you:

  • Install the app, or
  • Run bench migrate

Frappe automatically:

  1. Reads the fixture files
  2. Inserts missing records
  3. Updates existing records

This ensures consistency across environments.

User Guidance: When Should You Export Customizations?

You should export customizations when:

  • Moving from development to UAT
  • Preparing a production release
  • Deploying to multiple sites
  • Version-controlling ERP configurations

It is not required for temporary or experimental changes.

Best Practices & Tips

  • Always export fixtures before committing code
  • Keep fixture scope minimal to avoid noise
  • Export only relevant DocTypes
  • Avoid editing fixture JSON manually unless necessary
  • Use Git to track fixture changes

Advanced Topics

Filtering Fixtures by Condition

You can export only selected records:

fixtures = [
{
"dt": "Custom Field",
"filters": {
"module": "Selling"
}
}
]

This is useful for large ERPNext deployments.

Ordering of Fixtures

Frappe automatically manages dependency order, but complex apps should:

  • Export Custom DocTypes first
  • Then fields and property setters

This avoids validation errors during installation.

Integration Patterns

Exported customizations are commonly used with:

  • ERPNext vertical apps
  • Industry-specific modules
  • Multi-tenant ERP deployments
  • CI/CD pipelines for ERPNext

They integrate seamlessly with standard Frappe app workflows.

Troubleshooting Common Issues

Custom Fields Not Exported

  • Check hooks.py fixture configuration
  • Ensure fields are not hidden or disabled
  • Re-run bench export-fixtures

Duplicate Property Setters

  • Avoid exporting overlapping modules
  • Clean up unused customizations before export

Industry Relevance

Exporting customizations is critical in:

  • ERP consulting projects
  • Regulated industries (audit trails)
  • Large-scale ERP rollouts
  • SaaS ERP platforms

Target Audience

  • ERPNext Developers
  • Frappe Framework Developers
  • ERP Consultants
  • DevOps Engineers managing ERP deployments

Summary: Why Exporting Customizations Matters

Exporting customizations in Frappe Framework v15 ensures that ERPNext configurations are portable, version-controlled, and production-safe. By using fixtures, teams can confidently deploy changes across environments without risking data integrity—making it a cornerstone of professional ERPNext development.

Rating: 0 / 5 (0 votes)