SurfShopCart Documentation

Setting Up Shop Has Never Been Easier!

User Tools

Site Tools


importing_exporting_databases

Importing/Exporting Databases

Exporting Databases

All databases can be exported from the WebStore Manager into a plain text format for use with Excel, Access, FileMaker Pro or any other database program. You can use the Web Store Manager to export your data as a text file as either tab-separated or comma separated values.

Back up your data often, especially as your database grows. If your database becomes corrupted, you can delete the data on the server, run autoconfig and then import your data using the Admin.

Importing Databases

Data must be correctly formatted to be imported into the system. Failure to do so will result in CORRUPTED DATABASES.

For examples of correctly formatted data files, look at the various “.dat” files that came with the program in the ssdata/1/data directory.

  1. You must first format the data as either tab-delimited or comma-separated text. These are the only formats SurfShop™ will be able to accept.
  2. The first line of the data file must contain the correct SurfShop™ field headings for each column in the file. You can obtain these fields:
    1. From the “SurfShop™ Data Fields” section of this manual;
    2. By first exporting the data and then cutting the fields out of the resulting text file;
    3. By downloading the appropriate “.tmp” file from the ssdata/1/data directory.
    • Your data does not have to include all of the SurfShop™ fields; however, any fields that do not have corresponding data headers will be ADDED TO THE DATABASE (see “Adding Data Fields,” below).
  3. Select your data file by clicking the “browse” button below the “Import/Export Database” section of the appropriate Admin Page for the database in question.
  4. Select the appropriate data format (tab separated or comma separated)
  5. Select the desired replace method:
    • Add and Replace Matching — Adds new records and replaces matching records, but leaves all others intact.
    • Add New Only — Adds only records that do not already exist in the database, leaving all others intact.
    • Replace All — Deletes existing data and adds all new records.
  6. Click the Upload button to import the database.

Adding Data Fields to the Databases

The WebStore Admin gives you the ability to add and remove custom data fields to any of the databases. In order for any additional data fields to be used by the program, you must also modify the Admin Pages to accomodate the new data fields.

Fields that do not already exist in the database are automatically added when a file is imported. Be careful that you do not inadvertently add fields you did not intend to include in databases.

Special Character Sterilization

Certain characters cannot be stored in the databases. This caveat dates back to the earliest version of the program. By using MySQL and DBM relational database structures, these considerations are no longer necessary. We have kept these conventions for backward compatibility with our ASCII clients.

Backtick — All backtick (`) are converted to a single apostrophe (').

Carriage Returns — All carriage returns are stored as double backticks (``) in the system. Multiple lines are separated by the carriage return token or double backtick (``).

Whitespace characters — All tab, newline form feed, and backspace characters are converted to spaces.

Pipe — All pipes (|) are automatically deleted by the system.

Minibasket and Other SurfShop™-Specific Fields

Minibasket

The customer's order is stored in a single text field named “minibasket” in the orders database. Multiple lines are separated by the carriage return token or double backtick (``).

Each line represents an item in the customer's cart. Each field is separated by a pipe (“|”) character. Cart items are stored using the following fields:

  • UID
  • quantity
  • itemid
  • option1
  • option2
  • option3
  • other
  • optionprice
  • unitprice
  • shipping
  • hazardous
  • customfield
  • download
  • description
  • options
  • weight
  • volume
  • taxable

The “Download” field flags whether or not a payload item has been downloaded by the customer.

Options Catalog items may contain up to three separate options. Each option may have unlimited variations. The first line of the option is always the option name. Each subsequent option contains the Option description, followed by a double equals (==) and a price, if so desired. If no item unit price is specified, SurfShop™ will use the option pricing as the unit price for the item. See Catalog items for more information.

Categories Item categories are stored, one per line, in the “categories” field of the catalog database. Multiple categories would appear like this: “01001-00022``02033-00019``03099-00023-00007”. Each numeric code corresponds to a specific category in the categories database.

<<Main_Page Top^

importing_exporting_databases.txt · Last modified: 2018/07/03 04:55 (external edit)