> ## Documentation Index
> Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Using packages within channels/subchannels

There are several ways to get packages into a channel or subchannel:

* Upload a package file directly to a channel
* Create a mirror configuration and specify the source channel
* Copy/move specific packages from another channel

## Uploading to a channel

**Via the UI**

1. Visit the channel you want to upload packages to.
2. Click on the action button on the right side of the **Mirror** button and select the option to **Upload**.
3. In the modal that appears, select the file from your local computer that you want to upload.

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/kBuj3mPdZoBk8YoG/images/uploadtochan.png?fit=max&auto=format&n=kBuj3mPdZoBk8YoG&q=85&s=150b9df045e77f61fe121e18ac0c2c17" alt="" width="2782" height="1690" data-path="images/uploadtochan.png" />
   </Frame>

   A toast notification will appear informing you of success or failure.

**or**

1. Click on the user icon and choose **Upload Package**.
2. Choose the file to upload and what channel to upload it to.

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/kBuj3mPdZoBk8YoG/images/uploadtochan2.png?fit=max&auto=format&n=kBuj3mPdZoBk8YoG&q=85&s=ca34e63997a9b787ff16dec66d8547ba" alt="" width="2886" height="1664" data-path="images/uploadtochan2.png" />
   </Frame>

**Via the API**

```sh theme={null}
POST /api/channels/<CHANNEL_NAME>/artifacts
```

**Via the CLI**

```sh theme={null}
conda repo upload -c <CHANNEL_NAME><FILE_PATH>
```

## Uploading to a subchannel

**Via the UI**

1. Visit the subchannel you want to upload packages to.
2. Click on the action button on the right side and select the option to **Upload**.
3. In the modal that appears, select the file from your local computer that you want to upload.

A toast notification will appear informing you of success or failure.

**or**

1. Click on the user icon and choose **Upload Package**.
2. Choose the file to upload and what channel/subchannel combination to upload it to.

**Via the API**

```sh theme={null}
POST /api/channels/<CHANNEL_NAME>/subchannels/<SUBCHANNEL_NAME>/artifacts
```

**Via the CLI**

```sh theme={null}
conda repo upload -c <CHANNEL_NAME>/<SUBCHANNEL_NAME><FILE_PATH>
```

## Mirror to/from a channel

**Via the UI**

1. As an admin user, visit the channel you want to mirror to (the destination) and click the green **Mirror** button.
2. Enter the source of the mirror and whether that source is internal (a channel on this repo) or external (a channel on some other repo such as [http://www.anaconda.org](http://www.anaconda.org)).
3. Indicate whether you wish for the mirror to be passive (one time only) or active (synced with the source channel).

Additionally, you will be presented with other options for your mirror such as CVE score restrictions and frequency.

**Via the API**

```sh theme={null}
POST /api/channels/<CHANNEL_NAME>/mirrors
```

**Via the CLI**

```sh theme={null}
conda repo mirror --create<MIRROR_NAME> -c <DESTINATION_CHANNEL> -s <SOURCE> --mode<MODE>

# For example:
# conda repo mirror --create tm3 -c mychannel -s "https://conda.anaconda.org/conda-test" --mode passive
```

## Mirror to/from a subchannel

**Via the UI**

TBD

**Via the API**

```sh theme={null}
POST /api/channels/<CHANNEL_NAME>/subchannels/<SUBCHANNEL_NAME>/mirrors
```

**Via the CLI**

```sh theme={null}
conda repo mirror --create<MIRROR_NAME> -c <CHANNEL_NAME>/<SUBCHANNEL_NAME> -s <SOURCE> --mode<MODE>

# For example:
# conda repo mirror --create tm3 -c mychannel/dev -s "https://conda.anaconda.org/conda-test " --mode passive
```

## Copy/move packages to/from a channel

**Via the UI**

1. Go to the channel you want to copy packages to/move packages from.
2. Click on the **Packages** tab, where you will see a list of all the packages in that channel.
3. Select one or more packages, and then click **move** or **copy** to a new or existing channel.

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/FWjHZXWDjYmx0_bG/images/managepack.png?fit=max&auto=format&n=FWjHZXWDjYmx0_bG&q=85&s=0f6b78fef66e30f9103f9ceb2f9277f0" alt="" width="2308" height="1394" data-path="images/managepack.png" />
   </Frame>

**Via the API**

```sh theme={null}
POST /channels/<CHANNEL_NAME>/artifacts/bulk
```

**Via the CLI**

```sh theme={null}
conda repo copy <SPEC> -d<DESTINATION_CHANNEL>
conda repo move <SPEC> -d<DESTINATION_CHANNEL>

# where dest = <CHANNEL_NAME>[/<SUBCHANNEL_NAME>][::<PACKAGE>[/<VERSION>[/<FILE_NAME>]]]

# If file name is not given, copy all files in the version

# For example:
# conda repo copy john::bokeh/1.0.2/bokeh-1.0.2-py37_0.tar.bz2 -d john2
# conda repo move john::bokeh/1.0.2/bokeh-1.0.2-py37_0.tar.bz2 -d john2
```

## Copy/move packages to/from a subchannel

**Via the UI**

1. Go to the subchannel you want to copy packages to/move packages from.
2. Click on the **Packages** tab, where you will see a list of all the packages in that subchannel.
3. Select one or more packages, and then click **move** or **copy** to a new or existing channel or subchannel.

**Via the API**

```sh theme={null}
POST /channels/<CHANNEL_NAME>/artifacts/bulk
```

**Via the CLI**

```sh theme={null}
conda repo copy <spec> -d <CHANNEL_NAME>/<SUBCHANNEL_NAME>
conda repo move <spec> -d <CHANNEL_NAME>/<SUBCHANNEL_NAME>

# where dest =<CHANNEL_NAME>/<SUBCHANNEL_NAME>[::<PACKAGE>[/<VERSION>[/<FILE_NAME>]]]

#If filename is not given, copy all files in the version

# For example:
# conda repo copy john::bokeh/1.0.2/bokeh-1.0.2-py37_0.tar.bz2 -d john/ts2
# conda repo move john::bokeh/1.0.2/bokeh-1.0.2-py37_0.tar.bz2 -d john/ts2
```
