Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions docs/11-upgrading/03-migrate-from-legacy-auth.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
description: Move a Serverpod 3.5 project off serverpod_auth_server onto the modular auth stack with email, Google, and Flutter session continuity.
description: Move a Serverpod 4.0 project off serverpod_auth_server onto the modular auth stack with email, Google, and Flutter session continuity.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: May be out of scope of this PR, but I just noticed this description can be improved to make it easier to understand. Something like: "Upgrade from serverpod_auth_server to the latest auth module..."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 4.0 reference here is not in line with what the actual guide states below: it is for users running 3.4 or 4.0 betas.

sidebar_label: Migrate from legacy auth
---

# Migrate from legacy serverpod_auth

This guide is for apps still running `serverpod_auth_server` on Serverpod 3.4 or earlier 3.5 betas. At the end, existing users sign in through the new modular auth stack with their old passwords and old sessions, and your legacy endpoints keep working until every client has rolled forward. Plan for about an hour, plus migration runtime.
This guide is for apps still running `serverpod_auth_server` on Serverpod 3.4 or earlier 4.0 betas. At the end, existing users sign in through the new modular auth stack with their old passwords and old sessions, and your legacy endpoints keep working until every client has rolled forward. Plan for about an hour, plus migration runtime.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.4 or earlier... sounds like <=3.4.

Suggested change
This guide is for apps still running `serverpod_auth_server` on Serverpod 3.4 or earlier 4.0 betas. At the end, existing users sign in through the new modular auth stack with their old passwords and old sessions, and your legacy endpoints keep working until every client has rolled forward. Plan for about an hour, plus migration runtime.
This guide is for apps still running `serverpod_auth_server` on Serverpod 3.4 or later. At the end, existing users sign in through the new modular auth stack with their old passwords and old sessions, and your legacy endpoints keep working until every client has rolled forward. Plan for about an hour, plus migration runtime.


## Before you start

- A Serverpod 3.5.x project. If you are still on 3.4 or earlier, follow [Upgrade to 3.5](./upgrade-to-three-five) first.
- A Serverpod 4.0.x project. If you are still on 3.4 or earlier, follow [Upgrade to 4.0](./upgrade-to-three-five) first.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in line with what is stated above. It is a bit ambigous, but I interpret it as meaning 3.4 and later.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If upgrading to 4.0 is a requirement, this is based upon the migration to 4.0 PR #603 , and should thus be rebased upon that branch, right?

- Dart SDK 3.8.0 or later.
- Flutter SDK 3.32.0 or later (only if you are migrating the Flutter app).
- Postgres 14 or later, or SQLite3.
- The four auth packages at `3.5.0-beta.9` (or the matching beta on pub.dev): `serverpod_auth_core`, `serverpod_auth_idp`, `serverpod_auth_bridge`, and `serverpod_auth_migration`. These are still beta and may receive breaking changes before 3.5 stable.
- The four auth packages at `4.0.0` (or the matching beta on pub.dev): `serverpod_auth_core`, `serverpod_auth_idp`, `serverpod_auth_bridge`, and `serverpod_auth_migration`. These are still beta and may receive breaking changes before 4.0 stable.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove references to beta versions etc, and make it 4.0.0 ready.

- Back up your production database.
- Commit your current state on a clean branch.
- Restore a copy of production data into a staging environment and rehearse this guide against it before running it for real.
Expand All @@ -26,32 +26,32 @@ In `<project>_server/pubspec.yaml`:

```yaml
dependencies:
serverpod: 3.5.0-beta.9
serverpod_auth_server: 3.5.0-beta.9 # legacy, keep during migration
serverpod_auth_core_server: 3.5.0-beta.9
serverpod_auth_idp_server: 3.5.0-beta.9
serverpod_auth_bridge_server: 3.5.0-beta.9
serverpod_auth_migration_server: 3.5.0-beta.9
serverpod: 4.0.0
serverpod_auth_server: 4.0.0 # legacy, keep during migration
serverpod_auth_core_server: 4.0.0
serverpod_auth_idp_server: 4.0.0
serverpod_auth_bridge_server: 4.0.0
serverpod_auth_migration_server: 4.0.0
```

In `<project>_client/pubspec.yaml`:

```yaml
dependencies:
serverpod_client: 3.5.0-beta.9
serverpod_auth_core_client: 3.5.0-beta.9
serverpod_auth_idp_client: 3.5.0-beta.9
serverpod_auth_bridge_client: 3.5.0-beta.9
serverpod_client: 4.0.0
serverpod_auth_core_client: 4.0.0
serverpod_auth_idp_client: 4.0.0
serverpod_auth_bridge_client: 4.0.0
```

In `<project>_flutter/pubspec.yaml`:

```yaml
dependencies:
serverpod_flutter: 3.5.0-beta.9
serverpod_auth_core_flutter: 3.5.0-beta.9
serverpod_auth_idp_flutter: 3.5.0-beta.9
serverpod_auth_bridge_flutter: 3.5.0-beta.9
serverpod_flutter: 4.0.0
serverpod_auth_core_flutter: 4.0.0
serverpod_auth_idp_flutter: 4.0.0
serverpod_auth_bridge_flutter: 4.0.0
```

`serverpod_auth_bridge_client` and `serverpod_auth_bridge_flutter` are required for the session import covered later under [Update the Flutter app](#update-the-flutter-app).
Expand Down Expand Up @@ -294,6 +294,6 @@ Reach out on the [community page](../support).

## Related

- [Upgrade to 3.5](./upgrade-to-three-five): do this first.
- [Upgrade to 4.0](./upgrade-to-three-five): do this first.
- [Authentication setup](../concepts/authentication/setup): modular configuration reference.
- [Database migrations](../concepts/database/migrations): creating and applying schema changes safely.
Loading