Data Seeding
Data seeding gives every developer a working Strapi database without rebuilding the same pages, navigation, footer, roles, and demo content by hand.
The starter stores Strapi exports in the repository and can import the latest one automatically when baseline content is missing. This keeps local development close to the expected UI state: pages resolve, page-builder components have example content, and shared single types such as Navbar and Footer exist.
Use seed exports when a change needs content or configuration to travel with the code. Typical examples are new page-builder components, changed component schemas, updated demo pages, or baseline content required by the UI.
Seed imports overwrite existing Strapi data, so treat them as a project snapshot for development and test environments. For production, import intentionally and only when that is part of the deployment process.
How It Works
Seed exports live in the Strapi app:
apps/strapi/seed/exports/strapi-export-YYYY-MM-DD-HHmmss.tar.gz
The newest timestamped export is treated as the current seed. There is no separate promotion step.
When Strapi starts through the default scripts, scripts/seed-runner.mjs can run before the Strapi server starts:
- Load
.env. - Run
scripts/seed-check.mjs. - Load a Strapi instance without starting the HTTP server.
- Check whether baseline content exists through the Documents API:
PageNavbarFooter
- If required content is missing, run
scripts/seed-import.sh. - Import the latest timestamped export.
- Start Strapi normally.
Commands
All commands run from the monorepo root via Turbo.
Seed import and export scripts require bash. On Windows, use WSL, Git Bash, or another shell with Bash available.
pnpm seed:check # Check whether Page, Navbar, and Footer content exists
pnpm seed:import # Import the latest timestamped seed export
pnpm seed:export # Create a new timestamped seed export
seed:export keeps only the latest 5 exports.
Auto Seed Configuration
Automatic seeding is controlled by:
AUTO_SEED_ENABLED=true
AUTO_SEED_MODE=empty
AUTO_SEED_ENABLED defaults to true for strapi develop and false for strapi start when the variable is not set.
Available modes:
empty- import the latest seed export only when page, navbar, or footer content is missingprompt- ask before importing or overwriting content in an interactive terminalforce- always import the latest seed export; this overwrites existing dataskip- never import
For deployed environments, usually keep AUTO_SEED_ENABLED=false unless the environment should self-initialize (empty mode) or refilled (force mode).
Local Development Workflow
For normal development, start Strapi with dev script.
On startup, Strapi imports the newest seed export if baseline content is missing. This gives new developers a working local database without manual content setup.
PR Workflow
When a PR creates or changes Strapi collections, components, single types, or content that other developers need locally:
-
Make the schema or content changes in Strapi.
-
Export the updated seed:
pnpm seed:export -
Commit the new
seed/exports/strapi-export-YYYY-MM-DD-HHmmss.tar.gz. -
Open the PR with the schema/type/content changes and the new seed export together.
Other developers will pick up the new export when they pull the branch. On the next Strapi start, their local database will be seeded automatically if baseline content is missing. If they already have local content and need to apply the new export, they can run from root:
pnpm seed:import
Or they can start Strapi with AUTO_SEED_MODE=force to automatically import the new seed on startup.
Importing a Strapi export overwrites existing data, so developers should export or otherwise preserve local work before importing over it.
First Run Without Seed
If no seed export exists, create the baseline content manually in Strapi:
- Create one page in
Pagecollection withfullPathandslugset to/ - Create
Navbarsingle type content - Create
Footersingle type content
The UI supports en and cs by default, so enable both locales in Strapi and create localized content for both.