Skip to content

Command Line Runner Options

iceclow edited this page Sep 5, 2011 · 24 revisions

Migrate.exe can be called with the following parameters. The first three parameters are required if running a migration.
A lot of the parameters have more than one switch for the same parameter. If a parameter has an = sign after it, then it expects some text value to be set. Otherwise it is just a boolean switch e.g. the preview parameter.

An example:


Migrate.exe /conn "Data Source=db\db.sqlite;Version=3;" /provider sqlite /assembly your.migrations.dll /verbose

provider= | dbtype= | db= (required)

The kind of database you are migrating against. Available choices are: sqlserver2005, sqlserver2008, sqlserverce, sqlserver, mysql, postgres, oracle, sqlite, jet

assembly= | a= | target= (required)

The assembly containing the migrations you want to execute.

connectionString= | connection= | conn= | c= (required or connectionStringName)

The connection string to the server and database you want to execute your migrations against. This can be a full connection string or the name of the connection string stored in a config file.

When specifying a named connection string, FluentMigrator searchs for it in this order:

1. The specified config file via --connectionStringConfigPath parameter
2. Target assembly’s config file
3. Machine.config config file

connectionStringConfigPath= | configPath=

The path of the config file where the connection string named by is found. If not specified, it defaults to lookup order specified --connectionString parameter documentation

task= | t= (optional)

The task you want FluentMigrator to perform. Available choices are: migrate:up, migrate (same as migrate:up), migrate:down, rollback, rollback:toversion, rollback:all. Default is ‘migrate’.

verbose= (optional)

Show the SQL statements generated and execution time in the console. Default is false.

output | out | o (optional)

Output generated SQL to a file. Default is no output. Use outputFilename to control the filename, otherwise [assemblyname].sql is the default.

outputFilename= | outfile= | of= (optional)

The name of the file to output the generated SQL to. The output option must be included for output to be saved to the file.

namespace= | ns= (optional)

The namespace contains the migrations you want to run. Default is all migrations found within the Target Assembly will be run.

steps= (optional)

The number of versions to rollback if the task is ‘rollback’. Default is 1.

preview | p (optional)

Only output the SQL generated by the migration – do not execute it. Default is false.

version= (optional)

The specific version to migrate. Default is 0, which will run all migrations.

profile= (optional)

The profile to run after executing migrations.

timeout= (optional)

Overrides the default SqlCommand timeout of 30 seconds.

workingdirectory= | wd= (optional)

The directory to load SQL scripts specified by migrations from.

help | h | ?

Displays help menu.

Clone this wiki locally