Migration tool command usage

A number of commands may be added on the migration tool command line.

n4mig [options] <source> [target]

Parameter

Required?

Description / Notes

source

Yes

Typically the AX-3.8 station backup .dist file, but it may also be a bog file, palette file, station folder, or a zip archive of a station folder. You can enter an absolute file path, or a path relative to the current directory of the Niagara 4 console.

target

No

(Optional) The output station folder name to write the migrated station or BOG file. An absolute file path or a relative path can be entered. Any relative path is relative to the stations subfolder of your Workbench User Home, that is C:\Users\userName\Niagara4.x\<brand>\stations

 TIP: Generally, in a station migration you do not specify a target, as you typically want to retain the existing station name in the migrated station. If it is not specified, the migration tool derives it from the name of the source, its parent folder, or the name of a folder within the archive—whatever fits best. The exception is a source named config.bog. In that case, the target is required. If the supplied target is a relative path, the migration tool targets the result relative to the root of niagara_user_home/stations

If you do specify a target folder name, it cannot already exist (by default an existing station is never overwritten); however, any file path above it must exist. For a related example, see Migrator syntax example 2.

Options

Description / Notes

-version

Print NRE version information for this Workbench instance.

-log:level

Specify the log level, where level is one of the following:

all, finest, finer, fine, config, info, warning, severe, off

The default is “info”. This produces the text log file migration report, which lists all the changes made to the AX station as a result of the migration. This file is created in the root of the stations folder in your Workbench User Home. Of course the default (“info”) also includes any more problematic “warning” or “severe” messages.

After becoming familiar with migrations, you could specify the “warning” log level instead—that lists only the more problematic entries, shortening the log report.

-keepTemp

Do not clean up temp directories after execution. If used, a “migTemp” folder is left in your Workbench User Home, with various subfolders of intermediate files used in the migration process. Only use -keepTemp option for troubleshooting purposes.

-showSystemLogs

Shows messages from all loggers; does not hide non-migrator logs.

-help, -?

Print the usage information. By default you see this same information if you enter the n4mig command alone, that is without any other parameters or options.

-o

Overwrite the target station folder, if it already exists.

-t:<template>

When migrating a station backup .dist, this is the template type to use, where template is one of the migration station template types available on your system. Choices are:

1 = Controller migration template (for example, ControllerMigrationTemplate.ntpl)

2 = Supervisor migration template (for example, SupervisorMigrationTemplate.ntpl)

 NOTE: You can also use 'c' for the default Controller and 's' for the default Supervisor template.Default migration template files listed above are found in your Sys Home folder under !defaults/workbench/migrationTemplates. An empty migrationTemplates subfolder is also created in your Workbench User Home, to store any customized migration station template files. See the Niagara Templates Guide for more details on working with Niagara 4 templates.