copy

Copies a configuration file to the specified location using flash or SCP to replace current running configuration.

Syntax

copy {default-config | flash:// config-file/filename | scp://username:password@{ hostname}[:port]{/filepath }running-config

Parameters

copy
Specifies the copy function.
default-config
Specifies default configuration.
flash://
Specifies the flash device on which the file is stored.
config-file
Specifies the file is a configuration file.
filename
Specifies the name of the configuration file stored on the flash device.
Flash file command format: flash://config-file <filename>
flash-type [ config-file | coredumps | pcap-file | ms_images | chassis-ms | ifmgr-ms | lacp-ms | lldp-ms | mgmt-cli | mgmtsvc-apigw | mgmt-snmp-agent ]
Specifies the configuration file type.
scp://
Specifies use of the Session Control Protocol (SCP).
username
Account name of the authorized user.
password
Password of the authorized user.
hostname
Specifies the server by name or by IP address.
port
Specifies the port number, which must be preceded by a colon. If the port is not included, the default port is assumed.
filepath
Specifies the location from which to transfer the file using SCP.
SCP command format: scp://<username>:<password>@[hostname]/<filepath>
running-config
Specifies current running configuration.
default-config running-config
Clears the running configuration and replaces it with the default configuration.
running-config filepath
Copies running-config to a flash file or remote location using SCP.
Flash-file command format: flash://config-file/<filepath>
SCP command format: scp://<username><password>@[hostname]/<filepath>

Modes

Exec mode

Usage Guidelines

This command is available only to users with admin role.

After the copy default-config running-config command completes, the system reboots with only the management interface configuration.

Table 1. Error Messages
Message Reason
Error: Input file does not exist File named in the command is either misspelled or it doesn't exist at the location specified.
Error: Invalid user credentials. Username, password or both were entered incorrectly or the user does not have sufficient permissions to perform the operation.
Error: Host IP not reachable Host is either offline or specified incorrectly.
Error: Target file does not exist Self-explanatory. Verify file- and path are correct as entered.

Examples

The following example replaces the running configuration with the default configuration.

device# copy default-config running-config 

This operation will modify your running configuration. 
WARN: system will be rebooted to have configuration changes to take effect! 

Do you want to continue? [y/n]: 
Reloading.... please wait 

The following examples are some valid copy commands.

device# copy flash://config-file/testfile running-config 

device#scp://test:test@1.1.1.1:22/home/test/config-file/testfile running-config

device# copy default-config running-config

device# copy running-config flash://config-file/testfile