Importing Data into Your Database

This help file applies to an out-of-date version of MainBoss.
The most recent version of MainBoss is MainBoss 4.2.4.
This help file does not exist in MainBoss 4.2.4, but the index for that version can be found here.

< Previous section  |  Table of Contents  |  Index  |  Next section >

The Import verb of MBUtility imports data into your database from an input file. For example, if you are migrating to MainBoss from some other maintenance management software package, you might be able to import some subset of the data from that other package.

Important: Importing is a complicated procedure, and should only be done by people with strong IT expertise. We strongly recommend that you backup your database before you attempt an import operation. If an error occurs during an import operation, restore the database from backup, correct the error in the import data, then try again.

The command line for importing a single table is

mbutility import option option ...

where the options are:

/SchemaIdentification:schema
Specifies a data schema for exporting the data. This should be one of MBUtility's built-in schemas (as discussed in Built-In Data Schemas). Names are case-sensitive. If the schema name contains blank characters, the name should be enclosed in quotes, as in
/si:"Storeroom Assignment"
/Input:filename
Specifies a file containing the data to input. This file should use Unicode characters.
/ErrorOutput:file
Specifies a file where MainBoss should write any error messages that arise during the import process.
/OrganizationName:name
The name of the maintenance organization (associated with your MainBoss database). This name is case-insensitive; for example, MainBoss is the same as mainboss.
/DataBaseServer:servername
The name of the server that holds the MainBoss database.
/DataBaseName:name
The name of the MainBoss database.

If you specify /OrganizationName, you don't have to specify either /DataBaseServer or /DataBaseName. If you don't specify /OrganizationName, you must specify both of /DataBaseServer and /DataBaseName.

For example,

mbutility im /si:Unit /in:myfile /eo:errs /on:MainBoss

imports unit data from a file named myfile.

Important: This version of MainBoss will not let you import data that conflicts with existing records in the database. For example, if you are importing unit data, each new unit's identifier code must be different from any units that are already in the database. This means that you can't export MainBoss data, edit it with some other piece of software, then import it again to overwrite MainBoss's existing data.

ImportAll: The ImportAll verb imports multiple tables from a file. This file should have been created with ExportAll (as described in Exporting Data from Your Database) or with some process that creates data in the same format as ExportAll. ImportAll takes the same options as Import, except that you don't specify a /SchemaIdentification.

If you wish to create a database for testing, we recommend using backup and restore (using Create New Organization from Backup) rather than exporting and importing data. For more information, see Backups within MainBoss and Restoring a Backup Within MainBoss.

Tip: Sometimes it's difficult to figure out what format to use when you are preparing data for import. When in doubt, start up MainBoss and create a record of the type you intend to import; for example, if you intend to import Unit records, create a Unit record inside MainBoss. Then export the record as described in Exporting Data from Your Database. The format of the exported record will be the same that's expected for imported records.

CreateMainBossBasicDatabase: The CreateMainBossBasicDatabase verb creates a SQL Server database containing data from a MainBoss Basic database. This command does not create a MainBoss database. Instead, it takes XML data that was exported from MainBoss Basic and uses that data to create a generic SQL Server database. This may be useful if you are a MainBoss Basic user and you wish to use standard SQL Server facilities to make queries on MainBoss Basic data.

The CreateMainBossBasicDatabase verb takes the following options:

/DataBaseServer:servername
The name of the server where you wish to store the created database.
/DataBaseName:name
The name you want to give to the new database.
/Input:filename
Specifies a file containing the data to input. This file should be the XML file created by exporting data from MainBoss Basic.
/ErrorOutput:file
Specifies a file where mbutility should write any error messages that arise during the import process.

< Previous section  |  Table of Contents  |  Index  |  Next section >