Web App Migration - 'Old App'

Available in Chrome 147+ | View on GitHub | Browse Samples

This is the "Old App" (e.g. the 'migrating from' app) that is set up to migrate to the "New App", located here.

Background

This feature allows a PWA to migrate to a new origin or identity. Said another way, this feature allows a PWA to change it's id member (MDN) to a different value, as long as the origin of the new id is same-site as the current one.

manifest.webmanifest

{
  "name": "PWA Demo Old App",
  "short_name": "Old App",
  "description":
    "This is an 'old' app that the developer wants to migrate to a new same-site origin or same-origin id.",
  "id": "https://googlechrome.github.io/pwa-migration/migrate_from/",
  "start_url": "index.html",
  "display": "standalone",
  "scope": "./",
  "icons": [
    {
      "src": "icon.png",
      "sizes": "144x144",
      "type": "image/png"
    }
  ],
  "migrate_to": {
    "id": "https://googlechrome.github.io/pwa-migration/migrate_to/",
    "install_url": "https://googlechrome.github.io/samples/pwa-migration/migrate_to/index.html"
  }
}

Web App Origin Association file

To confirm that the migration is OK with the 'old' app origin, a key must be added to the /.well-known/web-app-origin-association file of the id of the 'new' app, with allow_migration: true

/.well-known/web-app-origin-association

{
  "https://googlechrome.github.io/pwa-migration/migrate_to/": {
    "allow_migration": true
  }
}