VFP database files are generally backed up in two forms. One is a record format, that is, a VFP table (. DBF) for storage. The advantage of this method is that the table data is backed up as is, note fields, common fields, and other special fields can be easily backed up and restored without special processing. The disadvantage is that once the record format is lost, the record cannot be recovered; the other is to back up records in text format. The advantage is that the text data is relatively stable and not easily damaged. The disadvantage is that special processing is required for the remarks field, common field, and other special fields, automatic backup and recovery are not easy.
Principles of backup and recovery for small Databases
The small database mentioned in this Article refers to a database whose file capacity cannot exceed one disk. For such a database, we commonly use the backup method: the copy to <path/backup1> command directly copies the database records and generates a backup1.dbf table file. If the original data table has a remarks field, a remarks file named backup1.fpt is generated at the same time, run the copy index indexfilename to <target path/filename1> command to back up the index file.
The second method is to use the copy to <path/backup1.txt> command to back up the original data table as a text file backup1.txt, use the copy structure to <path/backup1> command to back up the structure of the original data table as backup1.dbf. If the original data table has a remarks field, the remarks file backup1.fpt is generated. Note that when a text file is stored, do not use the copy to <path/backup1.txt> SDF command when the original data table has a remarks field, because the remarks file backup. FPT cannot be generated. The recovery method is to use the copy structure to command to restore the database structure, and then use the append from <path/backup1.txt> command to restore the data records, including the remarks field. Note that in this case, make sure that the remarks file backup1.fpt generated during Backup is intact.