copy <REMOTE-URL> {running-config | startup-config}

Syntax

copy <REMOTE-URL> {running-config | startup-config } [vrf <VRF-NAME>]

Description

Copies a file containing a switch configuration to the running configuration or to the startup configuration.

Command context

Manager (#)

Parameters

<REMOTE-URL>

Specifies the remote target for copying the file. Required. The syntax is the following: {tftp | sftp}://<IP-ADDRESS>[:<PORT-NUMBER>][;blocksize=<BLOCKSIZE-VALUE>]/<FILE-NAME>

{running-config | startup-config}

Selects whether the running configuration or the startup configuration receives the copied checkpoint configuration. If the startup configuration is already present, the command overwrites the startup configuration. Required.

vrf <VRF-NAME>

Specifies the VRF to receive the interface configuration. Optional.

Authority

Administrators

Usage

The switch copies only certain file types. The format of the file is automatically detected from contents of the file. The startup-config option only supports the JSON file format and checkpoints, but the running-config option supports the JSON and CLI file formats and checkpoints.

When a file of the CLI format is copied, it overwrites the running configuration. The CLI command does not clear the running configuration before applying the CLI commands. All of the CLI commands in the file are applied line-by-line. If a particular CLI command fails, the switch logs the failure and it continues to the next line in the CLI configuration. The event log (show events -d hpe-config) provides information as to which command failed.

Examples

Copying a JSON formatted file to the running configuration:

switch# copy tftp://192.168.1.10/runjson running-config vrf default
######################################################################### 100.0%
Configuration may take several minutes to complete according to configuration file size
 --0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%--
Success

Copying a CLI formatted file to the running configuration with an error in the file:

switch# copy tftp://192.168.1.10/runcli running-config vrf default
######################################################################### 100.0%
Configuration may take several minutes to complete according to configuration file size
 --0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%--
Some of the configuration lines from the file were NOT applied. Use 'show
events -d hpe-config' for more info.

Copying a CLI formatted file to the startup configuration:

switch# copy tftp://192.168.1.10/startjson startup-config vrf default
######################################################################### 100.0%
100.0%
Success

Copying an unsupported file format to the startup configuration:

switch# copy tftp://192.168.1.10/startfile startup-config vrf default
######################################################################### 100.0%
100.0%
unsupported file format