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

# Migrate from service beta

You can migrate your existing services from VESSL Service Beta to the latest version. This guide provides a step-by-step process to help you migrate your services.

Before you go, please refer to the new [Service YAML documentation](/docs/service/service-yaml) to understand the new features and changes.

## Assumptions

This guide is based on the following assumptions:

* You have a running VESSL Service on your organization.
* You have a running or stopped VESSL Service revision.
* You have the older version of `service.yaml` file as below format.

```yaml theme={null}
message: vessl-yaml-serve-test
launch_immediately: true

image: quay.io/vessl-ai/kernels:py39

resources:
  accelerators: T4:1
  spot: true

volumes:
  /root/examples:
    git:
      clone: https://github.com/vessl-ai/examples
      revision: 33a49398fc6f87265ac490b1cf587912b337741a

run:
  - workdir: /code/examples
    command: |
      python3 mnist.py

env:
  - key: TEST_ENV
    value: test

ports:
  - name: http
    type: http
    port: 8000

autoscaling:
  min: 1
  max: 1
  metric: cpu
  target: 50
```

## Start a migration

<Steps>
  <Step title="Get a new version of YAML by using CLI">
    You can get the new version of the YAML file by using the CLI.

    ```bash theme={null}
    vessl serve revision show --service <service_name> --number <revision_number> --format yaml
    ```

    Save the output to a new file, for example, `new_service.yaml`.
  </Step>

  <Step title="Manage the revision">
    You can use the new YAML file to create a new revision.

    Add `--set-current-active` or `-a` to set the new revision as the current active revision and activate the endpoint.

    ```bash theme={null}
    vessl serve create -f new_service.yaml --set-current-active
    ```
  </Step>
</Steps>

### Updating the revision

You can update traffic weight for the revision.

```bash theme={null}
vessl serve update --service <service_name> -n <revision_number> -w <weight>
```

### Terminating the revision

You can terminate the revision.

```bash theme={null}
vessl serve revision terminate --service <service_name> -n <revision_number>
```

## Reference: Differences between the old and new CLI

| API                                             | Status                | New CLI API                | Description                                                        |
| ----------------------------------------------- | --------------------- | -------------------------- | ------------------------------------------------------------------ |
| `vessl serve revision create`                   | Disabled and replaced | vessl serve create         | Use with new `service.yaml` schema.                                |
| `vessl serve revision update-autoscaler-config` | Disabled and replaced | vessl serve revision scale | Works same but changed in API Signature and options.               |
| `vessl serve gateway <subcommand>`              | Will be deprecated    | N/A                        | Gateway is automatically managed by the system and other commands. |
| `vessl serve revision list/show/terminate`      | Supported             | N/A                        |                                                                    |
| `vessl serve create`                            | New                   | N/A                        | Uses `service.yaml` for creating revisions and rolling out them.   |
| `vessl serve create-yaml`                       | New                   | N/A                        | Creates `service.yaml` by project configuration and your inputs.   |
| `vessl serve abort-update`                      | New                   | N/A                        | Force stops ongoing rollout and triggers rollback if possible.     |
| `vessl serve update`                            | New                   | N/A                        | Updates configuration for traffic splits.                          |

## Reference: Difference in configuring the gateway.

You used to enable the gateway by hand in web or using `service-gateway.yaml` file.

Now you can manage gateway configuration by CLI.

1. You can control traffic split with `vessl serve update` command.

```bash theme={null}
vessl serve update --service <service_name> -n <revision_number> -w <weight>
```

2. When the revisions are terminated or the service itself is deleted, the endpoint is automatically disabled.

Any questions or issues, please contact us at [support@vessl.ai](mailto:support@vessl.ai).
