Skip to content

docs: datastore migration guide for web#8578

Merged
cadivus merged 1 commit intodocs/datastore-migrationfrom
datastore-migration-disable-conflict-resolution
Apr 28, 2026
Merged

docs: datastore migration guide for web#8578
cadivus merged 1 commit intodocs/datastore-migrationfrom
datastore-migration-disable-conflict-resolution

Conversation

@soberm
Copy link
Copy Markdown
Contributor

@soberm soberm commented Apr 24, 2026

Description

Updates the DataStore-to-GraphQL migration guide to include backend changes required for a zero-downtime migration.

Problem

PR #8540 assumes clients can keep their Gen1 backend with DataStore/conflict resolution enabled. This is incorrect because:

  • Soft-deleted items (_deleted: true) remain in DynamoDB
  • Standard GraphQL clients (Apollo) receive ALL items including soft-deleted ones
  • Without _deleted in the schema, clients cannot filter them out

Solution

This PR documents the correct migration approach:

  1. Disable conflict resolution via amplify update api
  2. Manually re-add _deleted: Boolean to the GraphQL schema (maps to existing DynamoDB data)
  3. amplify push to apply changes
  4. Update frontend clients to filter { _deleted: { ne: true } }
  5. (Optional) Clean up soft-deleted items and remove _deleted field once all clients are migrated

Why this approach?

  • Zero-downtime: backwards-compatible with both DataStore and Apollo clients
  • No maintenance window required
  • No race conditions with in-flight deletions
  • Gradual migration path: clients can be migrated incrementally

Files changed

  • src/directory/directory.mjs — Added navigation entries for the new migration guide pages
  • src/pages/gen1/[platform]/.../migrate-from-datastore/index.mdx — Parent page explaining why backend changes are required
  • src/pages/gen1/[platform]/.../migrate-from-datastore/disable-conflict-resolution/index.mdx — Step-by-step guide for disabling conflict resolution

Testing

  • All 59 test suites pass (269 tests)
  • yarn prebuild generates directory.json successfully with new entries

Related: #8540

@soberm soberm requested a review from a team as a code owner April 24, 2026 09:42
@soberm soberm changed the base branch from main to docs/datastore-migration April 27, 2026 11:12
cadivus added a commit to cadivus/amplify-category-api that referenced this pull request Apr 27, 2026
Replace the internal docs-PR link (aws-amplify/docs#8578) with the
published Gen1 documentation page:

  https://docs.amplify.aws/gen1/react/build-a-backend/more-features/datastore/migrate-from-datastore

Three call sites updated:
- preserve-sync-fields.ts: module-level comment + MIGRATION_GUIDE_URL const
- appSync-walkthrough.ts: the 'No' branch info line added in Phase 5f

Tests reference MIGRATION_GUIDE_URL by symbol, not by literal, so the
25 existing tests pass unchanged.
@soberm soberm changed the title docs: Update DataStore migration guide - disable conflict resolution on backend docs: dataStore migration guide for web Apr 27, 2026
@soberm soberm changed the title docs: dataStore migration guide for web docs: datastore migration guide for web Apr 27, 2026
@soberm soberm force-pushed the datastore-migration-disable-conflict-resolution branch 2 times, most recently from 62f37e2 to 5043a9c Compare April 27, 2026 12:14
@soberm soberm force-pushed the datastore-migration-disable-conflict-resolution branch from 5043a9c to a6496fe Compare April 27, 2026 12:58
@cadivus cadivus merged commit ea4ac2c into docs/datastore-migration Apr 28, 2026
3 checks passed
@cadivus cadivus deleted the datastore-migration-disable-conflict-resolution branch April 28, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants