Importing Records from an Existing Database

Example

Importing contact records into MGI.

MGI Tags

  • mgiEditDatabase

Steps

  1. Export records in a tab-delimited format from any database program.
  2. FTP the tab-delimited file to the web server running MGI.
  3. View the database field administration page in a browser.
  4. Create a database field to match each field from the legacy database program.
  5. View the database record administration page in a browser.
  6. Select the database file.
  7. Select the database table.
  8. Import the tab-delimited file.


Step 1: Export records in a tab-delimited format from any database program.

Any tab-delimited text file can be imported into MGI. Most database programs such as FileMaker Pro, Access, and even Excel can export information into a tab-delimited format through a "Save As" or "Export" function. Export the data from the database program that you use in a tab-delimited format. Note the field structure of the data and the type of information in each field. This information will be helpful in Step 4 when you create the field structure in MGI.
 
In the contact database example, the field structure of Name, Company, Address, City, State, Zip Code, Phone Number, Fax Number, Email Address, Web Site, and Notes is exported as a tab-delimited file and named "contact.txt". The Name, Company, Address, City, State, Zip Code, Phone Number, Fax Number, Email Address and Web Site fields contain less than 250 letters, numbers, and standard ASCII characters (e.g., the @ sign and dashes), therefore "short text" fields will be created in MGI for this information during Step 4. The Notes field contains more than 250 characters, therefore a "long text" field will be created in MGI for this information during Step 4.

Step 2: FTP the tab-delimited file to the web server running MGI.

Upload the tab-delimited file (e.g., "contact.txt") to the web server using an FTP program.

Step 3: View the database field administration page in a browser.

View the database field administration page in a browser (a database field administration page contains the mgiEditDatabase tag, modifyTables parameter and modifyFields parameter). The first page of the web-based, administration interface is displayed.

Step 4: Create a database field to match each field from the legacy database program.

Create a new database file and table or add a table to an existing database file. In the empty table, add a field to match each field from the legacy database program. Field names must be entered in the order in which the information appears in the tab-delimited file.
 
To create a field, enter the case-sensitive field name in the area labeled "Name". Select a field type from the pop-up menu labeled "Type". Select "True" beside the "Indexed" label if the field will be used to order database search results. Select "False" beside the "Indexed" label if the field will not be used to order database search results. Click the "Add Field" button to add the field to the new database table. Fields are listed in the order they are created below the new field interface.
 
For example, short-text fields named "Name", "Company", "Address", "City", "State", "Zip Code", "Phone Number", "Fax Number", "Email Address", and "Web Site" and a long-text field named "Notes" (in that order) are created for the contact database

Step 5: View the database record administration page in a browser.

View the database record administration page in a browser (a database record administration page contains the mgiEditDatabase tag, modifyTables parameter and modifyRecords parameter). The first page of the web-based, administration interface is displayed.

Step 6: Select the database file.

All databases at the same level of the file structure as the database record administration page are displayed beside radio buttons under the sentence "Select a database". Select the radio button beside the database file that contains the table where you have created the field structure for the import. Click the "Select Database" button to view the tables in the database file.

Step 7: Select the database table.

All tables in the database file are displayed beside radio buttons under the sentence "Select a table:". Select the radio button beside the table where you have created the field structure for the import. Click the "Select Table" button to view the search screen of the record administration interface.

Step 8: Import the tab-delimited file.

At the record search screen, click the "Import File" button. In the text field under the sentence "Enter the import file location and press the "Import File" button:" enter the name of the tab-delimited file that you exported from the legacy database. When all records are imported, the message "The file was successfully imported into the TableName table of the DatabaseName database." is displayed. If the file is not successfully imported, an error message containing the import error is displayed. Import errors can occur if you try to import data into a field type that is not correct. For example, if you try to import text into a decimal field an error is displayed with the first record number and column where the error occurs.
 
Confirm the import by browsing through the records. Click the "Go To First Record" button to begin browsing and click the "Previous" and "Next" buttons to move between records.

[Return to the Populating Databases Menu]


[User Guide Main Menu] [Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]