How to configure the auto-importer
The information in the article refers to:
Monitor-Pro MP-5
Applies to:
| Product: | MP-5 |
| Reported Version: | MP5.0.1 |
| Applies to: | All MP-5 versions |
| Area of effect | Importer |
Overview of the Auto-Importer
MP-5 has a data importer, which imports files directly into the database. This is an optional add-on but saves considerable time when compared with manually adding data or importing single files using the wizard.
It is important that your system is set up correctly and that the files are in the correct format otherwise no data will be added to the database, and the import will fail.
Details
Within MP-5 the user can set up auto imports. As a part of Auto Import setup, a path to a folder and expected import file format is entered.
The Importer.exe is scheduled (using the Windows Scheduler) to run every x minutes. It looks at the folder that the user has set. If it finds a new file, it will attempt to import it.
If it can import the file then it will move to a process folder then into a folder called “Imported”. If it cannot import the file (e.g. a .bmp) then it will move it to a folder called “not imported”.
Sometimes, files are of the correct format to enter the database. However they may not match the contents of the database (e.g. import a data file for Landfill site abc when Landfill site abc does not exist in that database). In this event, the file will be imported to a holding bay, from where the user can resolve any conflicts. This functionality is called the import processor and is detailed below.
To gain more detailed information on imports and to track errors there is a function called Import log (found under “View” on the toolbar).
Set up the Windows Scheduler to run Auto Imports
- Go to the Control Panel and double click on Scheduled Tasks.
- Add Scheduled Task
- Click Next... then browse to the MP-5 Importer.exe (normally in C:\Program Files\Monitor Pro\Monitor-Pro 5\Bin).
- Select Daily... Next. Set the daily start time for the task (often 5:00 am or similar)
- Press Next... Enter your password.. Next
- Now check to open advanced properties when you click finish.
- Click Finish.
- A tabbed dialogue box appears. Go to Schedule then click Advanced. Now check Repeat Task and set a repetition time period (typically every 20 minutes or so) and set the duration. If you want the scheduler to run from 5 am to 8 pm then the duration would be 15 hours. Press OK.
- The header should say “Every 20 minute(s) from 05:00 hrs for 15 hour(s) every day, starting today.
- Click OK. You’re done with the scheduler.
How to run the Importer manually
Normally the importer is run on your server automatically, using the scheduler as above. However you can manually run the importer by double clicking on it. It's location is as in 3. above. If this is something you do regularly you may want to copy & paste a shortcut to it onto the desktop of the server.
If you are on a network then it is possible to manually start the importer from a client PC using it's Importer.exe. However in this configuration the path to the import folders in the import templates MUST be absolute, i.e. \\server\share\folder_name format. Otherwise the relative paths from clients would lead the importer to non-existent folders.
Share the “to import” folder(s)
If you are on a network, users will need to place their files to be imported in the “to import” folder(s). Therefore these will need to be made available as shared folders on your network.
Creating Auto Imports
To tell the importer what to expect when it runs, you must create an Auto Import template.
The template tells the importer what format the files are in, where the files are located, and provides the ability for additional options to be configured.
The configured imports are stored in MP-5 under the tools folder within the database explorer.
The MPR format is shared between LT and MP-5 to enable easier transfer of data.
This screen shot shows a set of MP-5 folders with each of the import types currently set up in the database.

Select one of these folders by clicking on it in the left hand box or double clicking in the right hand box, and then in the left hand box there will be a list of all the auto imports present in the database of that type.
You can then create a new auto import by double clicking on the Add New Auto Import icon, or set and existing auto import to import you files by double clicking on it.
Double clicking on the ‘Add New Import’ icon displays a blank import template:

The most important box here is the location box this is where you set where the auto importer will look for the files you are trying to import.
The folder containing the files you wish to import should be named ToImport so an example of what you location might look like would be: -
C:\MP-5 Data\Standard Variable Files\ToImport
When the importer is running a folder called process will be created this is where the files will be held while the importer is processing the data and adding it to the database.
Once the files are imported a folder called imported will be created; this folder will hold all the files that have been imported successfully into the database.
If the import fails because the files are in the wrong format for the selected auto import or if anything else goes wrong the files will be put into a folder called not imported.
Definitions
The ‘Definitions’ Tab allows you specify default values for key information is it is not present in the file.

It also allows you to specify the delimiters within the file if they are slightly non-standard.
Behaviour
The behaviour tab allows you to configure how the importer reacts to possible error situations.
