Cloning & Seeding Databases
Cloning Your Database
You can clone an existing database to create a seed file. Here’s how to create one:
$ mysqldump --all-databases -u mysql -p > seed.sql
$ pg_dump -U postgres -Fc postgres -f seed.dump
Note: The default password is
You are now the proud owner of a
Seeding Your Database
If you’re using Compose, follow the databases for Compose guide to seed your database.
Open the configuration for your database by clicking the gear icon next to its name, and select the Dockerfile tab.
Open the file menu by clicking the + icon in the file browser and select Upload File.
Select and upload your
seed.dumpfile to your container.
In the file editor, uncomment the
ADDcommand and replace
[src]with the path to your dump file, relative to your Dockerfile:
ADD [src] /seed.sql
ADD [src] /seed.dump
Note: Do not modify the destination
/seed.dump; it’s required to for the initialization script.
Your seeded database will now be created for all new builds.