copy

This topic explains the command that copies firmware images, configuration files, and log files between flash memory, TFTP, SCP, and USB locations.

Syntax

JSON
copy {flash:// | tftp://} {flash:// | tftp://}
copy {flash:// | usb://} {flash:// | usb://}
copy scp:// flash://

copy {tftp:// | scp:// | usb://} {backup-config | running-config | startup-config}
copy {backup-config | running-config | startup-config} {tftp:// | scp:// | usb://}

copy {backup-config | startup-config} running-config
copy {backup-config | running-config} startup-config
copy {running-config | startup-config} backup-config

copy tech-support {tftp:// | scp://}

Parameter

flash://: Specifies either the source file that is in flash memory or the destination file that must be stored in flash memory. The flash:// parameter can be one of the following files: flash://startup-config, flash://running-config, flash://backup-config, flash://image0, flash://image1, flash://ram.log, flash://flash.log.

tftp://: Specify the IP address of the remote TFTP server and the remote file name. Use the following format: tftp://<ip-address>/<path-to-remote-file>

usb://: Specify the file name on the USB device. Use the following format: usb://<filename>.

scp://: Specify the IP address of the remote SSH server and the remote file name. Use the following format: scp://<username>@<ip-address>:<path-to-remote-file>

running-config: Selects the running configuration file.

startup-config: Selects the startup configuration file.

backup-config: Selects the backup configuration file.

tech-support: Selects the technical support file.

Default

No default value.

Mode

Privileged EXEC

Usage

The switch includes multiple types of files, many of which are important for its management. The most common file operation is copy. The copy command lets you upgrade, back up, and copy the following types of files: firmware images, configuration files, and syslog files.

Important: The numbering of the firmware images in the CLI differs from the numbering in the device UI:

image0 in the CLI = image1 in the device UI

image1 in the CLI = image2 in the device UI

Example

This example shows how to copy the running configuration to the startup configuration:

CODE
Switch# copy running-config startup-config

This example shows how to back up the running configuration to a file named test1.cfg on a remote TFTP server with IP address 192.168.0.1:

CODE
Switch# copy running-config tftp://192.168.0.1/test1.cfg
Uploading file...Please Wait...
Uploading Done

This example shows how to upgrade the startup configuration from a file named test2.cfg on a remote TFTP server with IP address 192.168.0.1:

CODE
Switch# copy tftp://192.168.0.1/test2.cfg startup-config
Downloading file...Please Wait...
Downloading Done
Upgrade config success. Do you want to reboot now? (y/n)n

This example shows how to back up the startup configuration to a file named test3.cfg on a remote SSH server with IP address 192.168.0.1, using an account with user name 'user', placed in the /home/user/test directory:

CODE
Switch# copy startup-config scp://user@192.168.0.1:/home/user/test/test3.cfg
Uploading file. Please wait...
The authenticity of host '192.168.0.1 (192.168.0.1)' can't be established.
ED25519 key fingerprint is SHA256:dI8nnu4v2YrnaTCyYvV0Jn3vV/poRS4qoK38JD0aJr0.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Warning: Permanently added '192.168.0.1' (ED25519) to the list of known hosts.
user@192.168.0.1's password:
startup-config                                100% 1500     1.5KB/s   00:00
Uploading Done
Success