Sometimes it can be useful and necessery to import initial database entries to the WordPress database. The boilerplate comes with a mechanism that allows you to define tables, they get dumped into a single file and are imported automatically with the next WordPress installation.
{% hint style="info" %} It can be extremely helpful using initial imports for E2E tests. {% endhint %}
Here is a simple scenario you can adopt to your use case:
yarn docker:start
to start your WordPress installation- Login to your WordPress instance and create a new post
- Define tables you want to snapshot for the startup in
package.json#db:snapshot
like this"db:snapshot": ["wp_posts", "wp_postmeta"]
yarn db:snapshot-import-on-startup
to export the defined database tables into a file indevops/scripts/startup.sql
yarn docker:purge
removes your current WordPress installation completelyyarn docker:start
again and you will see that post is immediatly available