Skip to content

Commit

Permalink
docs: oel migrate and upgrade guide
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Jul 23, 2024
1 parent 81d0e36 commit 5bd3c7c
Show file tree
Hide file tree
Showing 2 changed files with 184 additions and 0 deletions.
63 changes: 63 additions & 0 deletions docs/self-hosted/oel/migrate.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
id: migrate
title: Migrate to Ory Enterprise License
---

# Upgrade Ory Hydra to Ory Hydra Enterprise License (OEL)

This guide outlines the steps to upgrade from Ory Hydra open source to Ory Hydra Enterprise License (OEL). Upgrading to OEL
provides additional features and support for enterprise customers.

## Prerequisites

Before starting the upgrade process, ensure you meet the following requirements:

1. **Valid Ory Enterprise License**: You must have purchased an Ory Enterprise License.
2. **Access to the Ory Enterprise Docker Registry**: You need access to download the OEL Docker images.
3. **Ory Hydra Version**: Your current Ory Hydra installation must be version 2.0 or higher.
4. **Backup and Testing**: Create a backup of your current Ory Hydra database and test the migration on a test environment to
ensure compatibility and minimize risks.

## Upgrade process

Follow these steps to upgrade from Ory Hydra open source to Ory Hydra Enterprise License (OEL):

### 1. Keep the open source version running

Ensure that your current open source version of Ory Hydra is running.

### 2. Run the OEL Image for database migration

Use the Ory Hydra Enterprise License Docker image to run the `hydra migrate sql up` command against the database of the open
source service. This step applies the necessary database migrations for OEL.

```bash
docker run --rm \
-e DSN=your_database_connection_string \
europe-docker.pkg.dev/ory-artifacts/ory-enterprise/hydra-oel:<version> \
migrate sql up -e -f config.yml
```

Replace `your_database_connection_string` with your actual database connection string.

### 3. Switch to Ory Hydra Enterprise License

After successfully migrating the database:

1. **Stop the Open Source Version**: Shut down your current open source Ory Hydra service.
2. **Start the Ory Hydra Enterprise License Version**: Launch the Ory Hydra OEL using the same database connection string and
configuration, but with the OEL Docker image.

```bash
docker run -d \
-e DSN=your_database_connection_string \
-p 4444:4444 -p 4445:4445 \
europe-docker.pkg.dev/ory-artifacts/ory-enterprise/hydra-oel:<version> \
serve all -c config.yml
```

Ensure to replace `your_database_connection_string` with your database connection string used in the migration step.

## Conclusion

By following these steps, you can successfully upgrade from Ory Hydra open source to Ory Hydra Enterprise License.
121 changes: 121 additions & 0 deletions docs/self-hosted/oel/upgrade.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
id: upgrade
title: Upgrading Ory Hydra OEL
---

This document provides a comprehensive guide on how to upgrade your Ory Hydra Enterprise License (OEL) version. Upgrading to the
latest version ensures you have the newest features, security updates, and performance improvements.

## Prerequisites

Before proceeding with the upgrade, ensure you have:

- A valid Ory Enterprise License.
- Access to the Ory Enterprise Docker Registry.
- Backup of your current data and configuration.

## Pick the right version

To upgrade Ory Hydra OEL, you need to know the version you are currently running. Check your Docker or Kubernetes environment to
find the tag. You should find your tag in this list:

```mdx-code-block
import ImageTags from "./eol-image-tags.md"
<ImageTags />
```

:::note

Zero-downtime migrations are only possible if you do not skip any version when upgrading.

:::

The tags are ordered by date. To upgrade, you need to pick the next version in the list.

## Upgrade Using Helm Charts in Kubernetes

Upgrading Ory Hydra OEL in Kubernetes is straightforward when using Ory's Helm Charts. Follow these steps to upgrade Ory Hydra
OEL:

### 1. Enable auto SQL migration

Set `hydra.automigration.enabled` to `true` in the `values.yaml` file:

```
image:
# ....
# ...
hydra:
automigration:
enabled: true
# ...
```

### 2. Update the image tag

```
image:
repository: europe-docker.pkg.dev/ory-artifacts/ory-enterprise/hydra-oel
tag: <replace-with-current-image-tag>
# ...
```

### 3. Apply / install the helm chart

You can now apply the upgrade:

```bash
helm upgrade ory-oel-hydra ory/hydra --namespace ory -f values.yaml
```

#### 4. Wait for the upgrade to propagate

Once the init container is done and the main container is running, the upgrade is complete.

## Upgrade steps without Helm Charts

### 1. Check Release Notes

Before upgrading, review the [release notes](https://changelog.ory.sh) for the new version to understand the changes, new
features, and any deprecations.

### 2. Backup Your Data

Ensure you have a complete backup of your database and configuration files. This step is crucial for restoring your system in case
of an upgrade failure.

### 3. Pull the Latest Docker Image

Pull the latest Ory Hydra OEL Docker image from the Ory Enterprise Docker Registry:

```bash
docker pull europe-docker.pkg.dev/ory-artifacts/ory-enterprise/hydra-oel:<new-version-tag>
```

### 5. Apply SQL Migrations

Before deploying the service, you need to apply SQL migrations:

```bash
docker run -e DSN=cockroach://... europe-docker.pkg.dev/ory-artifacts/ory-enterprise/hydra-oel:<new-version-tag> -- migrate sql -e -f /path/to/config.yaml
```

### 5. Stop the Service

Once done, you can stop the processes running the old service.

### 6. Start the Service

Now you will be able to start the service:

```bash
docker run -e DSN=cockroach://... europe-docker.pkg.dev/ory-artifacts/ory-enterprise/hydra-oel:<new-version-tag> -- serve all -f /path/to/config.yaml
```

## Conclusion

Upgrading Ory Hydra OEL is essential to keep your system secure and up-to-date. By following the steps outlined in this guide, you
can ensure a smooth upgrade process with minimal downtime.

If you encounter any issues during the upgrade process, please reach out to the Ory support team for assistance.

0 comments on commit 5bd3c7c

Please sign in to comment.