3. Customers Importing

This section describes how to perform osCommerce customers import to osCommerce from .csv file - bulk update of customers.

Pay attention to each Wizard's page while importing osCommerce customers. Import is a rather complicated procedure and it may be destructive if performed incorrectly. Create database backup before importing customers, especially if you do it for the first time.

To import customers to osCommerce follow a few steps listed below:

    1. First of all prepare a .csv file for import. Make sure it contains all the necessary fields and all data you'd like to import are listed in the table.
      1. If you have osCommerce customers' list in Excel, you can convert your Excel files to the CSV format within the Microsoft Excel or OpenOffice application by using the Save As option. You can then access the Save As dialog box which contains a list of alternative file formats. Among the file extensions offered, you can find Text CSV file format. By saving your file into CSV format, Microsoft Excel or OpenOffice will export the first active worksheet with the correct delimiters.
    2. Select "Import" and click "Next >" to proceed.

3. Specify the .csv file path and name or use browse button

to select one.

You can load previously saved import configuration on this step.

4. Source file preview shows a part of .csv file selected to import. There are no options to set, but you should pay some attention to the following fields delimiter and quote character, if some are used.

If you carefully check the very first line of the example, you'll notice that some words enclosed in quotes (") and are separated by comma (,) symbol. That are two important options you have to pay attention to - you will have to setup these settings on the next page. Usually it is seen in the first line, no need to investigate entire file.

    1. Also you can enable and set the row # you want to start import from.
    2. Select fields delimiter and quote character. If you specify wrong values, import may not work.
    • Delimiter Character. Most popular delimiters are comma (,), semicolon (;) and tab character ( ), however other symbols can be used as well.
      • Note. CSV file contains data in row-column format and delimiter character is used to separate one column from another. If you specify incorrect delimiter, file will not be parsed properly and osCommerce customers import will not be performed.
    • Quote string values delimiter will be used to separate strings in .csv file. This delimiter can be disabled if none of the values are used.
      • On previous sample page we have noticed that comma symbol was used as delimiter and values were quoted with " symbol. Specify two first settings as shown above.
      1. The next page allows you to Link columns from .csv file to appropriate database fields.
    1. Specify the following options:
      • First row in .csv file contains field names but not values - Obviously it should be unchecked if first row of .csv file contains data, otherwise check this option.
      • Customer identification method - Import will search for osCommerce customer using selected method of identification. The osCommerce customer will be modified if found, if not - new osCommerce customer will be added.
      1. To link columns from .csv file to appropriate database fields simply click on any database field in the left pane "Database Fields" and after that click on appropriate column from .csv file. The Database Fields pane shows the list of fields in your database that can receive import data. So, to assign .csv column to database field you should select a field at the left pane and then click a column at the right pane.
      2. Source .csv file can contain multiple records, you can assign a few fields, only those you would like to update.
      3. Note that sometimes one of key fields may be blank. Obviously blank fields contain the same value for all records. It is required to assign .csv columns for key fields (used by osCommerce Customers Identification Method option, see above).
      4. Database Fields contain the following columns:
      • Rec ID - contains database field ID. Field - contains database field name. Some values in this column contain actual field name, whereas other are "translated". Anyway these names are clear enough to figure out how to use them.
      • csv col # - the number of the column in .csv file corresponding to this field - the link between database field and .csv column. Delete the value in order to unassign database field.
      • Set Null - indicates that this field should not contain any data, but should be set to Null. You can either specify column name or check this option, but not both of them at the same time.
      • Update - used to set some default value to the field, similar to Set Null, but in this case some value can be assigned to the field.
      • Default value - enter the value assigned to a field (is used only if "Update" option is enabled).
      1. [Auto Fill...] button - try to set correspondence automatically for all fields. Auto fill option will work only if .csv column name is the same as database field name ("translated").
      2. [Clear] button - clear all "csv col" values at the left pane
    2. Base Formats and Separators are used to convert text values from .csv file to numerical and date values. You can set default values using an appropriate button.
    1. Customers were not imported to your database yet. On Import Preview page you can see how .csv file was processed using import settings, which you specified at previous steps. Check whether all columns that you want to be imported are filled with data as some of them may be blank. It means that either you haven't assigned .csv column or it is empty in source (.csv) file. Columns that were not assigned will not be imported, whereas empty values will overwrite existing.
    1. Red blinking arrow will be shown to draw your attention if any errors occurred.
    2. Import options page may affect Import results. Please read and check your selection carefully.
    1. Create new customer using ID from source file (Not recommended) - allows you to import osCommerce customers with their original IDs.
      1. Save Import Configuration
      2. All import settings can be stored under some configuration. You can load it next time you decide to import osCommerce customers to osCommerce from a file with similar formatting, column names etc.
      3. Attention! Import process will start, when you press "Import" Button! Proceed only if all settings are made, otherwise press "Back" Button and check settings once more!
    2. Procedure complete. Here you see a number of items imported and if any errors occurred during the import.
      1. Most frequent import errors are date, time and number of conversion issues, caused by invalid format settings (specified at previous pages) or improperly assigned column (i.e. if you assign column containing text data to numeric database field). Date/time conversion errors might be ignored, whereas other errors have to be fixed.
    1. Now import of osCommerce customers to osCommerce is finished.

By eMagicOne Inc.