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

# forest roles:copy

> Copy the permissions of every role from one environment to another

# forest roles:copy

Copy the permissions of all roles from one environment to another environment of the same project.

## Usage

```bash theme={null}
forest roles:copy --from <ENVIRONMENT> --to <ENVIRONMENT> [options]
```

## Options

| Option | Description |
| - | - |
| `-f, --from` | Name of the source environment (required) |
| `-t, --to` | Name of the destination environment (required) |
| `-p, --projectId` | The ID of the project to work on |

`roles:copy` runs once per pair of environments, whatever the number of roles and teams. It targets environments that share the same schema. Between environments whose schemas differ, such as a legacy back-end and a new one, use [`forest roles:export`](https://docs.forest.app/reference/cli/roles-export) and [`forest roles:apply`](https://docs.forest.app/reference/cli/roles-apply), which match permissions by collection and action name.

## Examples

```bash theme={null}
# Copy production permissions to staging
forest roles:copy --from Production --to staging

# Copy permissions in a specific project
forest roles:copy -f staging -t Production -p 42
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.