Repository navigation
Command init
github-actions[bot] edited this page Nov 17, 2026
·
1 revision
Creates migrate-mongo.yaml and a migrations project. Tool only.
migrate-mongo init [--project <path>] [--auth aws] [--file <path>]
$ migrate-mongo init --project src/MyApp.Migrations
Created migrate-mongo.yaml
Created src/MyApp.Migrations/MyApp.Migrations.csproj
Created src/MyApp.Migrations/Program.cs
Created src/MyApp.Migrations/.editorconfig
Next: set MONGODB_URL, then run `migrate-mongo create <Name>` and `migrate-mongo status`.
| Option | Default | Meaning |
|---|---|---|
-p, --project
|
Migrations |
Where to create the project. If it already has a .csproj, that project is used instead and only the config is written. |
--auth aws |
Also reference Kevsoft.MigrateMongo.Aws for AWS IAM authentication. |
|
-f, --file
|
migrate-mongo.yaml |
Where to write the config file. |
-
<project>.csproj: targets your SDK's .NET version and referencesKevsoft.MigrateMongo.RunnerandMongoDB.Driver(and, with--auth aws,Kevsoft.MigrateMongo.AwsandMongoDB.Driver.Authentication.AWSat the same version as the driver). -
Program.cs:return await MigrateMongoRunner.RunAsync(args); -
.editorconfig: makes CA2016 a warning, so calls that don't pass the migration'sCancellationTokenare flagged. -
migrate-mongo.yaml:project:pointing at the project,mongodb.url: ${MONGODB_URL},databaseName(the first part of the project name, lower-cased) and the main settings with their defaults. With--auth aws, a comment shows an AWS IAM connection string.
-
Project Setup, including the
dotnet newtemplates - Configuration
Kevsoft.MigrateMongo ·
NuGet ·
Releases ·
Issues ·
Found a mistake? These pages live in
wiki/ on main; pull requests welcome.
Get started
Migrations
- Writing Migrations
- Transactions
- Recording Results
- Dependency Injection
- Custom Templates
- Adopting an Existing Database
Collections
- Managing Collections
- Indexes
- Search Indexes
- Collection Options
- Validators
- Views
- Undeclared Collections
Deploying
Connecting
Reference
Concepts