dbcopy - Database Copy - Database Copy

dbcopy [-cdEpfiRt] [-I flddatfile] [-S srcdir] [-D destdir] sourcedataarea destinationdataarea [filename|systemcode ...]

dbcopy -V

The dbcopy command is used to copy data from one data area to another data area. By default, the data in all the files is copied. If only the files in a system code or specific files should be copied, list them in the command. The files copied must be in both dictionaries and, unless the -c option is specified, they must have the same structure (the database columns are the same).

Program Option Description
c Convert data where the two files do not exactly match. Columns in both files are copied and columns only in the destination file are set to the default value. If the files are the same, no conversion is done.
d Delete the file and indexes from the destination data area database (if they exist), create the file in the database, copy the data, and then create the indexes before copying.
E Exclude IsView objects in the destination.
p Precreate indexes before copying. Only use with -d.
f Fix records, if needed, while copying.
i Ignore errors while copying.
R Reject records with bad keys while copying.
t Truncate the file in the destination data area database prior to copying the data.
I

Read data to initialize destination file fields.

The format for the data in flddatfile is:

FileName FieldName FieldOccurrence FieldValue

where:

  • FileName is the file in the destination data area that this row contains a default value for.

  • FieldName is the name of a field in FileName that this row contains a default value for.

  • FieldOccurrence is the field's occurrence value.

  • FieldValue is the default value you want to populate FieldName .

The data in flddatfile may be space, tab, or comma-delimited. Each entry (row) is delimited by a new line character.

If FieldName in flddatfile exists in both source and destination data areas, then the corresponding FieldValue overrides the value read in from the source database.

S Read source data from files in the srcdir directory.
D Write destination data to files in the destdir directory.
V Prints the version of dbcopy.