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

# 4.7: Upgrade guide

> Complete typed contact attributes and verify migrated storage URLs.

**Applies to:** installations crossing 4.7, including upgrades to a later 4.x or 5.x target.
Docker/one-click and Kubernetes, both editions. See the [upgrade path](https://formbricks.com/docs/self-hosting/upgrade/paths.md).

## Before

* Back up application data and files. Allow time for contact-attribute and storage-URL data migrations.
* The attribute migration infers `text`, `number` or `date` for each key. It counts only number/date values that match
  the conversion pattern, are nonempty and still lack a typed value. Below **1,000,000 eligible values**,
  it fills those columns; at or above that threshold, it skips the value backfill. Use the migration logs
  to decide whether the backfill below is needed; the total attribute count is not the threshold.
* Storage URLs in surveys, styling, branding and response data are converted to relative paths. Keep the
  existing S3 endpoint, bucket and proxy route; this is not a transfer to another storage provider.

## During

Use the [4.x/5.x procedure](https://formbricks.com/docs/self-hosting/upgrade/legacy.md) for those targets, or the v6 procedure for a v6 target.
Check the application/migration logs for `Skipping value backfill`. A successful schema migration does not
mean a skipped backfill has completed.

### Complete a skipped backfill

Run the script from the **installed release image**, after its migrations succeed. Do not run multiple
copies concurrently. Complete it before you upgrade to the next minor version.

> [tab] Docker
>
> Run from the directory containing your existing `docker-compose.yml`. The app must be running on the
> upgraded image; keep public traffic closed until the backfill finishes.
>
> ```bash theme={null}
> docker compose exec -T formbricks node packages/database/dist/scripts/backfill-attribute-values.js
> ```

> [tab] Kubernetes
>
> ```bash theme={null}
> kubectl exec -n <namespace> deploy/<app-deployment> -- \
>   node packages/database/dist/scripts/backfill-attribute-values.js
> ```
>
> Replace the namespace and app deployment with your existing names.

Wait for exit `0` and `Backfill Complete!`. The script fills only missing typed values and can resume after
interruption; batches commit independently. It avoids the migration transaction timeout but still uses
database resources. Stop and investigate any error before advancing.

## After

* Check number/date segment filters against known contacts, including invalid or empty values.
* Open old survey images and previously uploaded response files through the public route.
* Compare surveys and responses with the baseline and complete the [acceptance checks](https://formbricks.com/docs/self-hosting/upgrade/rehearse.md#acceptance-at-every-stop).

## Recovery

Keep the old configuration and coordinated backup. Use [restore](https://formbricks.com/docs/self-hosting/operate/backup-restore.md) if
repair cannot complete; reverting an image does not undo URL or attribute-data rewrites.

All changes: [4.7.0 changes](https://github.com/formbricks/formbricks/compare/4.6.1...4.7.0) and the
[backfill script](https://github.com/formbricks/formbricks/blob/4.9.7/packages/database/src/scripts/backfill-attribute-values.ts).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.