ReadMe File for BizDB Housekeeping Facility ################################################################## # # BizDB - Housekeeping Facility # # IMPORTANT: This housekeeping facility is an add-on feature of our # BizDB database system. Before installing and using this facility, # you should have our BizDB database system installed on your server. # # You can use the CGI scripts and the sample Html interfaces provided # by this software to: # # (1) import data from comma, tab or pipe (|) delimited flat ASCII # files to generate BizDB compatible database files, # (2) export data from BizDB database files to comma, tab # or pipe (|) delimited flat ASCII files, # (3) backup all text files stored in the BizDB database directory # to a backup directory specified by the Webmaster, # (4) restore all text files from a backup directory (specified # by the Webmaster) to the BizDB database directory. # (5) list all the backup directories created by the Webmaster so far # # Software Limitations - This software works on text files only. It # does not import, export, backup or restore binary (eg image) files. # ################################################################## # # Demonstration Website: http://www.cnctek.com/bizdb-html/ # E-mail: cnctek@cnctek.com # # MINIMUM SERVER REQUIREMENTS: # # Runs on a Unix Operating System; Provides FTP; # Supports Perl and cgi-bin; Allows creation of files and # directories by cgi programs. # # ************************************************************* # ORDER OF THIS SOFTWARE IS NOT REFUNDABLE. WE ARE GLAD TO # PROVIDE TECHNICAL ASSISTANCE AT REASONABLE COST. # ************************************************************* # # COPYRIGHT NOTICE # The BizDB software is a product of CNC Technology. All rights reserved. # Only the user with our permission can use and modify this software. # Also permission is granted to execute this software on one domain name # only. Without CNC Technology's permission, no part of this script can be # reproduced ( other than the backup copy ), resold or redistributed to # any other indivituals, companies and organizations. # # DISCLAIMER: # # These Scripts are provided on a "As Is" basis. CNC Technology # will not be liable ( nor responsible ) whatsoever for any direct # or indirect damages caused by the use of this Software # ( or Scripts ). # ################################################################## Please read the following paragraphs carefully. This is essential if you want to have a smooth and successful installation. When you read this file, we know that you have successfully decompressed our ZIP file using a 32 bits WinZip (or equivalent) program. ################################################################## TABLE OF CONTENTS: A. Contents in our ZIP file B. System Configuration Parameters C. Import Data for BizDB Databases D. Export BizDB Database Data For 3rd-Party Software E. Backup and Restore BizDB Databases F. Installation Procedures ################################################################## A. Contents in our ZIP file You should have at least the following files for a standard version of our system: (1) backup-restore.cgi - This is the CGI script used for: - backing up all database text files in the BizDB database directory to a backup directory specified by the Webmaster. - restoring all database text files from a backup directory created earlier to the BizDB database directory. - deleting the whole backup directory specified by the Webmaster. (2) backup-restore.html - This is the sample Web page used for backing up and restoring the BizDB database text files. You can also use it to delete any existing backup directories. ********************************************* (3) import_dbs.cgi - This CGI script will generate BizDB database files using the data stored in comma or tab delimited flat ASCII files created either by you manually or by a 3rd-party PC software. (4) import_dbs.cfg - This file contains the list of input (comma or tab delimited flat ASCII files) and output (BizDB database) filenames. (5) import-dbs.html - This is the sample Web page used for the import database function. ********************************************* (6) export_dbs.cgi - This CGI script will export the BizDB database record files specified by export_dbs.cfg . (7) export_dbs.cfg - This file contains the list of BizDB database filenames to be exported. (8) export-dbs.html - This is the sample Web page used for the export database function. ********************************************* (9) ReadMe.txt - It's this document. If you have used our development assistance, we will include more files to meet your specific needs. This will be mentioned in a separate document or e-mails. B. System Configuration Parameters: You will have to modify a number of System Configurations Parameters in the Scripts before you can upload them to your CGI-BIN directory. These parameters are CGI script specific, therefore you should read our following sections or the notes on our scripts very carefully. Parameter Name Where Description (1) $maxfields export_dbs.cgi Number of fields in the database to be exported. The value of this variable must match with that used in the "bizdb-aed.cgi" script. (2) $superpwd import_dbs.cgi Supervisor password. You and your export_dbs.cgi Webmaster must enter this password backup-restore.cgi to the Housekeeping Web pages in order to execute any housekeeping functions. (3) $database_dir import_dbs.cgi Full pathname of the directory export_dbs.cgi in which your BizDB database backup-restore.cgi record files are stored. (4) $description_dir export_dbs.cgi Pathname of the "long text fields" directory. This variable is used by our "ImageDB" software. For BizDB Starter, Standard and Advance Versions which do not have this variable defined in the "bizdb-aed.cgi" script, you must set this variable to "". (5) @desc_flds import_dbs.cgi List of description (long text) fields to be saved on text files in the description directory. Filename will be the "Record ID". If f10,f15 are non searchable long fields, set @desc_flds = ('f10','f15'); The value of this variable must match with that defined in your "xxxx-aed.cgi" script. This variable is used by our "ImageDB" software. For BizDB Starter, Standard and Advance Versions which do not have this variable defined in the "bizdb-aed.cgi" script, you must set this variable to (). (6) $import_dir import_dbs.cgi Full pathname of the directory containing the input ASCII text (database) files. The software will use the data in these files to generate the BizDB database files. (7) $import_cfg import_dbs.cgi Filename of the import specification file. NOTE: The "import specification file" is used to tell the "import_dbs.cgi" program where the import data are and the filenames of the output BizDB database files. Import Specification File Format: ================================ Start from column 1, the 1st "db001.txt" is the input file, the 2nd "bizdb1" is the BizDB formatted file. The | character is the field delimitor. Cols 12345678901234567890 line 1 db001.txt|bizdb1 line 2 db002.txt|bizdb2 Each line of the file must contain one pair of input (import) and output BizDB filenames, starting from column 1 and must be terminated by a linefeed (use the "Enter" key on your keyboard). The software will read in the data from the import files and then output the converted data files to the directory defined by "$database_dir" in BizDB format. The "Import Specification File" must be copied to the directory defined by $config_dir. (8) $export_dir export_dbs.cgi Full pathname of the directory containing the exported database files. Must be stored in a Html directory. (9) $export_dir_url export_dbs.cgi Full URL of the directory containing the exported files. (10) $export_cfg export_dbs.cgi Filename of the export specification file. NOTE: The "export specification file" is used to tell the "export_dbs.cgi" program which BizDB database files are required to be exported. Export Specification File Format: ================================ Cols 123456789 line 1 bizdb1 line 2 bizdb2 Each line of the file must contain one filename of a "to-be-exported" BizDB database file, starting from column 1 and must be terminated by a linefeed (use the "Enter" key on your keyboard). This software will process all the BizDB database files and export the flat ASCII files to the export directory defined by $export_dir . The "Export Specification File" must be copied to the directory defined by $config_dir. (11) $config_dir import_dbs.cgi Pathname of the directory export_dbs.cgi containing the import or export specification files. The value of this variable can be set equal to the value of $template_dir defined in "bizdb-aed.cgi". (12) $delimitor_in import_dbs.cgi For "import_dbs.cgi": export_dbs.cgi This is the field delimitor used in the import flat ASCII database file(s). You can use "\t" (tab), or "\|" (pipe), or "," (comma), or " _ " only. For "export_dbs.cgi": This is your BizDB database Field Delimitor. You can use "\t" (tab), or "," (comma), or " _ " only. The setting here must be identical to that used in bizdb-aed.cgi (13) $delimitor_out import_dbs.cgi For "import_dbs.cgi": export_dbs.cgi This is the field delimitor of the output (converted) database file in BizDB format. You can use "\t" (tab), or "," (comma), or " _ " only. The setting here must be identical to that used in bizdb-aed.cgi For "export_dbs.cgi": This is the field delimitor for the exported flat ASCII files. You can use "\t" (tab), or "," (comma), or "|" (pipe), or " _ " only. (14) $uid_pwd_sep import_dbs.cgi Userid and Password separator is used in field #1 of each record. The setting here must be identical to that used in bizdb-aed.cgi (15) $auto_gen_f1_to_f5 import_dbs.cgi If $auto_gen_f1_to_f5 = "yes", this software will generate and insert fields f1-f5 automatically into each of the BizDB records. If $auto_gen_f1-f5 = "", the software will not insert f1-f5 automatically. All fields in the BizDB records are to be extracted from the input database file. (16) $default_rec_creation_date import_dbs.cgi Default record creation date (yyyy/mm/dd) If $default_rec_creation_date = "", the software will store today's date (yyyy/mm/dd) into "f2" of each record. This variable is used only when $auto_gen_f1_to_f5 = "yes". (17) $default_rec_type import_dbs.cgi Output BizDB database record type (will be stored in "f4" of each record). You can only set it to either "Free" or "Standard" or "Enhanced". This variable is used only when $auto_gen_f1_to_f5 = "yes". (18) $default_rec_status import_dbs.cgi Output BizDB database record status (will be stored in "f5" of each record). You can only set it to either "Inactive" or "Active". This variable is used only when $auto_gen_f1_to_f5 = "yes". (19) $move{'f??'} import_dbs.cgi export_dbs.cgi The move array defines how each of the fields in the source database file are to be moved to the destination database file. For "import_dbs.cgi", the destination file is the BizDB database file. For "export_dbs.cgi", the destination file is the Export file. $move{'f1'} = "f6" means that field #1 ("f1") of all input records will be moved to field #6 ("f6") of the output records. There must be one $move{'fxx'} = "fyy"; statement defined for each field in the BizDB records. >>>> For "import_dbs.cgi" >>>> If $auto_gen_f1-f5 = "yes", the first field for "fyy" must be "f6" or higher. If $auto_gen_f1-f5 = "", the first field for "fyy" can be "f1" or higher. >>>> For "export_dbs.cgi" >>>> This "move" array will be used only if $export_selected_fields = "yes". If $export_selected_fields = "", all fields will be exported in the same order. >>>> For both import & export scripts >>>> You can extract any fields in the input file to generate the output file. You can increase or decrease the number of $move statements to generate only the fields you needed for the BizDB database or Export file. Example of $move statements: $move{'f1'} = "f6"; $move{'f2'} = "f7"; $move{'f3'} = "f8"; (20) $rec_nr_file import_dbs.cgi Filename of the record number allocation file (see "bizdb-aed.cgi") NOTE: This "record number allocation file will store the record number of the last database record if $auto_gen_f1_to_f5 = "yes". The record id of the 1st record will be set equal to 1 and will be incremented by 1 for the next record until all records in the import files are processed. This file will not be generated if $auto_gen_f1_to_f5 = "". This file will be used only if $auto_assign_rec_nr in "bizdb-aed.cgi" is equal to "yes". The value of this $rec_nr_file variable must be identical to that used in the "bizdb-aed.cgi" script. (21) $backup_dir backup-restore.cgi Full pathname of the directory in which your backup databases will be stored. This is the main backup directory containing all the backup sub-directories created for you via the Html interface. (22) $return_url backup-restore.cgi Return URL link used by OK and error messages. (23) @valid export_dbs.cgi These are the urls (separated backup-restore.cgi by comma) that are allowed to execute this database system. This prevents any of our programs to be accessed by unauthorized Websites. (24) $charset import_dbs.cgi Define the character set to export_dbs.cgi be used by your housekeeping backup-restore.cgi software. This is required for supporting non-English languages. See your BizDB documentation. (25) $serverOS import_dbs.cgi Set this parameter to "unix" backup-restore.cgi if your server is running on an Unix or Linux operating platform. Set it to "nt" for Windows NT. (26) $quote_all_fields The default setting is "". export_dbs.cgi Under this setting, only the fields containing the Delimitor or " Characters will be quoted in the output (exported) database file. Set $quote_all_fields to "yes" if you want to quote all output fields unconditionally. (27) $export_selected_fields The default setting is "". export_dbs.cgi Under this setting, all fields in the BizDB database file will be exported in the same order. Set $export_selected_fields to "yes" if you want to export certain fields in the BizDB database file in certain order. ******************************************* PARAMETERS CHECKLIST: export_dbs.cgi - $charset, $maxfields, $superpwd, $database_dir, $description_dir, $export_dir, $export_dir_url, $export_cfg, $config_dir, @valid, $delimitor_in, $delimitor_out, $quote_all_fields, $export_selected_fields import_dbs.cgi - $serverOS, $charset, $superpwd, $import_dir, $database_dir, $import_cfg, $config_dir, $description_dir, @desc_flds, @valid, $auto_gen_f1_to_f5, $default_rec_creation_date, $default_rec_type, $default_rec_status, $move{'f??'}, $rec_nr_file, $delimitor_in, $delimitor_out, $uid_pwd_sep backup-restore.cgi - $serverOS, $charset, $superpwd, $database_dir, $backup_dir, $return_url, @valid C. Import Data for BizDB Databases Related Software Files: import_dbs.cgi, import_dbs.cfg, import-dbs.html //NOTE//: There is no need to install these files if you don't need to use our import database feature. You can use the sample "Import and Convert Database Files for BizDB" Web page to generate your BizDB database files. Your "Import Database" FORM must contain the following statements: