How to Export & Deploy Frappe HRMS Master Data with Fixtures


Managing HR data in Frappe HRMS can often involve repetitive tasks, especially when moving from a development environment to production. One of the most common challenges is replicating master data like Departments, Designations, and Branches without manual re-entry. Thankfully, Frappe provides a clean and scalable solution — Fixtures.
In this guide, I’ll walk you through how to leverage fixtures to migrate your HRMS master data effortlessly while following best practices for deployment.
Before diving in, let’s clarify what qualifies as master data in Frappe HRMS:
Typically, you create these records during your development or testing phase. Recreating them in production is time-consuming and error-prone. Instead, exporting them as fixtures saves time and ensures consistency.
Fixtures in Frappe are powerful because they:
Once set up, you won’t have to worry about missing master data when deploying to production.
hooks.pyNavigate to your custom app (or Frappe HRMS app) and open hooks.py. Add the following snippet:
fixtures = [
{"dt": "Department"},
{"dt": "Designation"},
{"dt": "Branch"},
{"dt": "Employment Type"},
]You can include any other master data DocTypes as needed.
Run the export command from your terminal:
bench export-fixturesThis creates JSON files inside your app’s fixtures/ directory:
your_app/fixtures/Department.json
your_app/fixtures/Designation.jsonThese files contain the data you created in development.
Track your fixtures in Git:
git add your_app/fixtures/
git commit -m "Added HRMS master data fixtures"
git pushNow, your master data travels with your app.
Once on your production server, pull the latest changes and run:
bench migrateFrappe will automatically detect and import the fixtures along with applying patches and schema changes.
📉 All your departments, designations, and other master data are now available in production.
Anytime you update master data in development, repeat:
bench export-fixturesThen, commit and migrate again to update production.
If this feels too technical, Frappe’s Data Import Tool is always an option for one-time imports. However, fixtures are the best choice for ongoing projects and continuous deployment.