For most systems, by far the best method of backing up your DP4 database is that described in DYNABACK - Backup in Native DP4 Database Format
You can either make a complete backup of your database including all the files that together make up the database, or you can opt to back up only the .LOG file.
You can back up the database to hard disk or to removable media such as a diskette or tape, or both. If you back up to the local hard disk only you can restore the database quickly, but you are not covered in the event of a hard disk failure. It is a much better idea to back up to a second hard disk, for example a drive on a network server that is automatically backed up each night by a tape streamer. It is also a good idea to keep a backup available on hard disk, as this is likely to permit a faster restart after a system crash. However, this does require extra hard disk space.
There are two different utilities for backing up a database, with a range of facilities:
The original backup program is called DBBACKUP. It is geared towards backing up a database to diskettes, which is inconvenient for large databases, at least if you only have a standard diskette drive, though it may be acceptable if you have a Zip drive. Until release 4.622 DBBACKUP also partially supports backing up to tape. A key feature (or major disadvantage) of DBBACKUP is that it cannot be used while the database is in use.
The newer backup program is called DYNABACK. It supports backup to diskette in the same format as DBBACKUP but with the difference that the backup can be made while the database is in use. From release 4.522/4.618 it has a new facility to back up the database by creating a copy of the database under a different name. This has two very important benefits:
The backed up database can have a full integrity check done on it. The result of this check is the same as running a check on the main database immediately prior to the backup completing. You will therefore have checked your live database for integrity, and can be sure that the backup copy of the database is good.
In the event of a system failure and a failure in the usual roll-back recovery process, DBRECOV can use the last backup in this format to automatically restore the database, without the need for user intervention.
For further details see Dynamic Backup.
When using the original diskette style backup with either DBBACKUP or DYNABACK you can control where the backup is made, using the directory assignment option of DFSETUP to set up the desired default location for backup files. You can over-ride the backup location with the -DISK command tail when running DBBACKUP (or DYNABACK from 4.522). This allows you to arrange, for example, to back up to hard disk on a daily basis, and to disk on a weekly basis. (For details see Specifying the Backup Location.)
If the total size of all database files is very close to or exceeds 4GB, then the only way to back up the database correctly, at least until release 4.622, is:
DYNABACK -COPY -NOSPACE.
As of release 4.622 all the DP4 backup utilties can work with databases of any size, provided the underlying operating system supports sufficiently large files.
An alternative to using the DP4 backup utilities is to use the facilities provided by the operating system or third party software to copy the database files. Be careful when writing a script/batch file to do this, because:
You must make sure the database files are all closed before attempting to copy them. (See Shutting down a database.)
You must make sure ALL the database files are copied.
You must run the SETSESSN utility with the -DELETE command tail to perform a dummy backup. This increments the database session number and deletes the transaction log. A new transaction log is started in the next session when you carry out a database transaction. (Under Windows 3.1 it is not possible to run DP4 for Windows programs from DOS batch files. So, running utilities like SETSESSN has to be done manually after running the backup utility).