Once you have set up your production deployment, you'll need some way to get your products and other data into the system.
The main tasks will be:
The recommended way to create the schema for a new production deployment is to generate an initial migration locally against an empty database. This migration will contain the full database schema for your current Vendure configuration, and can then be committed to source control and run in production in the same way as all later schema changes.
To create the initial migration:
dbConnectionOptions.synchronize set to false.If your server entry point already calls runMigrations(config) before bootstrap(config), the committed initial migration will be applied automatically when the server starts.
Another possible way to create the schema for a brand-new, empty database is to temporarily enable TypeORM's synchronize feature for the first run. This is simpler, but an initial migration is preferable because it makes the production schema reproducible and auditable.
If you use this approach, enable synchronize with an explicit boolean environment variable:
Set the DB_SYNCHRONIZE variable to true on first start, and then after the schema is created, set it to false or remove it. Do not pass the raw environment variable directly to synchronize, because environment variables are strings and the string "false" is still truthy.
For ongoing schema changes, always use migrations rather than synchronize.
Importing initial and catalog data can be handled by Vendure populate() helper function - see the Importing Product Data guide.
Any kinds of data not covered by the populate() function can be imported using a custom script, which can use any Vendure service or service defined by your custom plugins to populate data in any way you like. See the Stand-alone scripts guide.