# Installation Guide

## Copying files (copy command)

The `copy` command allows you to copy one repository, the source, to another repository, the target. The target repository can be on the same EMSRV server as the source, or on a different EMSRV server that is on the same network.

The `copy` command locks the library to ensure that the library cannot be changed while it is being copied.

To use the `copy` command, the following conditions must exist:

- The specified source file must be a valid VisualAge library file.
- The EMADMIN user must know the EMSRV account password.
- The password characters are not displayed on the screen.
- The library file can be copied only if the correct password has been entered.
- To run the `copy` command in a batch file, the password may be specified as part of the command line. This, in conjunction with the `-q` (quiet) option, ensures that no prompting occurs during the batch process.

The syntax for the copy command is:

    EMADMIN copy [-o] [-p<password>][-q][ -P<port number> ] <source> <dest>

Parameter | Description
--- | ---
`<source>` | A valid VisualAge library file; the source file will be locked.
`<dest>` | File specification must be accessible to the EMSRV user account. A VisualAge file specification has the following format:
    <ip_address>:<file name>
`<ip_address>` is optional and specifies the host that EMSRV is running on. It can be either the file server IP host name or its Internet address. If a host name is not provided, `localhost` is used. `<file name>` is required and is the file specification.

Modifier | Description
--- | ---
`-o` | The `copy` command default behavior does not overwrite an existing file. Normally, you are prompted for overwrite permission. The `-o` option specifies that the destination file may be overwritten without prompting.
`-p` | This specifies the password to use when the `copy` command is validating access to the source database. The password cannot contain spaces.
`-q` | By default, the `copy` command prints the number of bytes transferred during the copy operation. The `-q` option indicates "quiet operation" and the transfer count is not printed. When this option is enabled, you will not be prompted about potential problems from low disk space.
`-P <port number>` | This is an optional parameter that specifies the port that EMSRV is using . The default numbers is 4800.

For example, to copy a library file to a backup file, enter the following command:

    emadmin copy -o -p secret -q 15.1.33.20:manager.dat 15.1.33.20:test.dat

This example copies (in quiet mode) `manager.dat` to `test.dat` in the working directory, overwriting `test.dat` if it exists and using the password "secret" to access the source library.

[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]