mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 18:30:32 -06:00
843 lines
29 KiB
Plaintext
843 lines
29 KiB
Plaintext
export const metadata = {
|
|
title: "Migrating Formbricks to the Latest Version",
|
|
description:
|
|
"Each Latest Version of Formbricks comes with an exciting set of new features & functionality while cutting down significantly on the bugs at the same time! No need to build the image again! This guide will help you migrate your existing Formbricks instance to the up-to-date instance",
|
|
};
|
|
|
|
#### Self-Hosting
|
|
|
|
# Migration Guide
|
|
|
|
## v2.4
|
|
|
|
Formbricks v2.4 allows you to create multiple endings for your surveys and decide which ending the user should see based on logic jumps. This release also includes many bug fixes and performance improvements.
|
|
|
|
<Note>
|
|
This release will drop support for advanced targeting (enterprise targeting for app surveys) with actions
|
|
(e.g. only target users that triggered action x 3 times in the last month). This means that actions can
|
|
still be used as triggers, but will no longer be stored on the server in order to improve the overall
|
|
performance of the Formbricks system.
|
|
</Note>
|
|
|
|
### Steps to Migrate
|
|
|
|
This guide is for users who are self-hosting Formbricks using our one-click setup. If you are using a different setup, you might adjust the commands accordingly.
|
|
|
|
To run all these steps, please navigate to the `formbricks` folder where your `docker-compose.yml` file is located.
|
|
|
|
1. **Backup your Database**: This is a crucial step. Please make sure to backup your database before proceeding with the upgrade. You can use the following command to backup your database:
|
|
|
|
<Col>
|
|
<CodeGroup title="Backup Postgres">
|
|
|
|
```bash
|
|
docker exec formbricks-postgres-1 pg_dump -Fc -U postgres -d formbricks > formbricks_pre_v2.4_$(date +%Y%m%d_%H%M%S).dump
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
<Note>
|
|
If you run into “No such container”, use `docker ps` to find your container name, e.g.
|
|
`formbricks_postgres_1`.
|
|
</Note>
|
|
|
|
<Note>
|
|
If you prefer storing the backup as an `*.sql` file remove the `-Fc` (custom format) option. In case of a
|
|
restore scenario you will need to use `psql` then with an empty `formbricks` database.
|
|
</Note>
|
|
|
|
2. Pull the latest version of Formbricks:
|
|
|
|
<Col>
|
|
<CodeGroup title="Stop the containers">
|
|
|
|
```bash
|
|
docker compose pull
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
3. Stop the running Formbricks instance & remove the related containers:
|
|
|
|
<Col>
|
|
<CodeGroup title="Stop the containers">
|
|
|
|
```bash
|
|
docker compose down
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
4. Restarting the containers with the latest version of Formbricks:
|
|
|
|
<Col>
|
|
<CodeGroup title="Restart the containers">
|
|
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
5. Now let's migrate the data to the latest schema:
|
|
|
|
<Note>To find your Docker Network name for your Postgres Database, find it using `docker network ls`</Note>
|
|
|
|
<Col>
|
|
<CodeGroup title="Migrate the data">
|
|
|
|
```bash
|
|
docker pull ghcr.io/formbricks/data-migrations:latest && \
|
|
docker run --rm \
|
|
--network=formbricks_default \
|
|
-e DATABASE_URL="postgresql://postgres:postgres@postgres:5432/formbricks?schema=public" \
|
|
-e UPGRADE_TO_VERSION="v2.4" \
|
|
ghcr.io/formbricks/data-migrations:latest
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
The above command will migrate your data to the latest schema. This is a crucial step to migrate your existing data to the new structure. Only if the script runs successful, changes are made to the database. The script can safely run multiple times.
|
|
|
|
6. That's it! Once the migration is complete, you can **now access your Formbricks instance** at the same URL as before.
|
|
|
|
### Additional Updates
|
|
|
|
- The `CRON_SECRET` environment variable is now required to improve the security of the internal cron APIs. Please make sure that the variable is set in your environment / docker-compose.yml. You can use `openssl rand -hex 32` to generate a secure secret.
|
|
|
|
## v2.3
|
|
|
|
Formbricks v2.3 includes new color options for rating questions, improved multi-language functionality for Chinese (Simplified & Traditional), and various bug fixes and performance improvements.
|
|
|
|
### Steps to Migrate
|
|
|
|
<Note>
|
|
You only need to run the data migration if you have multi language surveys set up in the Chinese language
|
|
(`zh`). If you don't have any surveys in Chinese, you can skip the data migration step.
|
|
</Note>
|
|
|
|
This guide is for users who are self-hosting Formbricks using our one-click setup. If you are using a different setup, you might adjust the commands accordingly.
|
|
|
|
To run all these steps, please navigate to the `formbricks` folder where your `docker-compose.yml` file is located.
|
|
|
|
1. **Backup your Database**: This is a crucial step. Please make sure to backup your database before proceeding with the upgrade. You can use the following command to backup your database:
|
|
|
|
<Col>
|
|
<CodeGroup title="Backup Postgres">
|
|
|
|
```bash
|
|
docker exec formbricks-postgres-1 pg_dump -Fc -U postgres -d formbricks > formbricks_pre_v2.3_$(date +%Y%m%d_%H%M%S).dump
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
<Note>
|
|
If you run into “No such container”, use `docker ps` to find your container name, e.g.
|
|
`formbricks_postgres_1`.
|
|
</Note>
|
|
|
|
<Note>
|
|
If you prefer storing the backup as an `*.sql` file remove the `-Fc` (custom format) option. In case of a
|
|
restore scenario you will need to use `psql` then with an empty `formbricks` database.
|
|
</Note>
|
|
|
|
2. Pull the latest version of Formbricks:
|
|
|
|
<Col>
|
|
<CodeGroup title="Stop the containers">
|
|
|
|
```bash
|
|
docker compose pull
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
3. Stop the running Formbricks instance & remove the related containers:
|
|
|
|
<Col>
|
|
<CodeGroup title="Stop the containers">
|
|
|
|
```bash
|
|
docker compose down
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
4. Restarting the containers with the latest version of Formbricks:
|
|
|
|
<Col>
|
|
<CodeGroup title="Restart the containers">
|
|
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
5. Now let's migrate the data to the latest schema:
|
|
|
|
<Note>To find your Docker Network name for your Postgres Database, find it using `docker network ls`</Note>
|
|
|
|
<Col>
|
|
<CodeGroup title="Migrate the data">
|
|
|
|
```bash
|
|
docker pull ghcr.io/formbricks/data-migrations:v2.3.0 && \
|
|
docker run --rm \
|
|
--network=formbricks_default \
|
|
-e DATABASE_URL="postgresql://postgres:postgres@postgres:5432/formbricks?schema=public" \
|
|
-e UPGRADE_TO_VERSION="v2.3" \
|
|
ghcr.io/formbricks/data-migrations:v2.3.0
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
The above command will migrate your data to the latest schema. This is a crucial step to migrate your existing data to the new structure. Only if the script runs successful, changes are made to the database. The script can safely run multiple times.
|
|
|
|
6. That's it! Once the migration is complete, you can **now access your Formbricks instance** at the same URL as before.
|
|
|
|
### Additional Updates
|
|
|
|
The feature to create short urls in Formbricks is now deprecated. Previously generated short urls will keep working for now but we recommend to use the long urls instead. Redirect support for short urls will be removed in a future release.
|
|
|
|
## v2.2
|
|
|
|
Formbricks v2.2 introduces XM research presets into your products with a brand new product onboarding. Our objective is to make user research “obviously easy”, industry by industry. And we're starting with Software-as-a-Service and E-Commerce.
|
|
|
|
### Steps to Migrate
|
|
|
|
This guide is for users who are self-hosting Formbricks using our one-click setup. If you are using a different setup, you might adjust the commands accordingly.
|
|
|
|
To run all these steps, please navigate to the `formbricks` folder where your `docker-compose.yml` file is located.
|
|
|
|
1. **Backup your Database**: This is a crucial step. Please make sure to backup your database before proceeding with the upgrade. You can use the following command to backup your database:
|
|
|
|
<Col>
|
|
<CodeGroup title="Backup Postgres">
|
|
|
|
```bash
|
|
docker exec formbricks-postgres-1 pg_dump -Fc -U postgres -d formbricks > formbricks_pre_v2.2_$(date +%Y%m%d_%H%M%S).dump
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
<Note>
|
|
If you run into “No such container”, use `docker ps` to find your container name, e.g.
|
|
`formbricks_postgres_1`.
|
|
</Note>
|
|
|
|
<Note>
|
|
If you prefer storing the backup as an `*.sql` file remove the `-Fc` (custom format) option. In case of a
|
|
restore scenario you will need to use `psql` then with an empty `formbricks` database.
|
|
</Note>
|
|
|
|
2. Pull the latest version of Formbricks:
|
|
|
|
<Col>
|
|
<CodeGroup title="Stop the containers">
|
|
|
|
```bash
|
|
docker compose pull
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
3. Stop the running Formbricks instance & remove the related containers:
|
|
|
|
<Col>
|
|
<CodeGroup title="Stop the containers">
|
|
|
|
```bash
|
|
docker compose down
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
4. Restarting the containers with the latest version of Formbricks:
|
|
|
|
<Col>
|
|
<CodeGroup title="Restart the containers">
|
|
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
5. Now let's migrate the data to the latest schema:
|
|
|
|
<Note>To find your Docker Network name for your Postgres Database, find it using `docker network ls`</Note>
|
|
|
|
<Col>
|
|
<CodeGroup title="Migrate the data">
|
|
|
|
```bash
|
|
docker pull ghcr.io/formbricks/data-migrations:v2.2 && \
|
|
docker run --rm \
|
|
--network=formbricks_default \
|
|
-e DATABASE_URL="postgresql://postgres:postgres@postgres:5432/formbricks?schema=public" \
|
|
-e UPGRADE_TO_VERSION="v2.2" \
|
|
ghcr.io/formbricks/data-migrations:v2.2
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
The above command will migrate your data to the latest schema. This is a crucial step to migrate your existing data to the new structure. Only if the script runs successful, changes are made to the database. The script can safely run multiple times.
|
|
|
|
6. That's it! Once the migration is complete, you can **now access your Formbricks instance** at the same URL as before.
|
|
|
|
### Changes in Environment Variables
|
|
|
|
- `ONBOARDING_DISABLED` is now deprecated since we replaced the user onboarding with a product onboarding that only runs when creating a new product.
|
|
|
|
## v2.1
|
|
|
|
Formbricks v2.1 introduces more options for creating No-Code Actions and lays the foundation for easier self-hosting of Formbricks starting with an Onboarding for fresh instances.
|
|
|
|
<Note>
|
|
To improve the user experience in self-hosting instances and to simplify setup, we are moving to a single
|
|
organization approach for self-hosting instances with this release. This will allow self-hosters to
|
|
centrally manage their instance and more easily restrict access to the instance. We will soon introduce a
|
|
new permissions system that will allow more granular access to projects and other resources within an
|
|
organization. If you have created multiple organizations in the past, you will still be able to switch
|
|
between them in the UI, but don't have an option to create new organizations.
|
|
</Note>
|
|
|
|
### Steps to Migrate
|
|
|
|
This guide is for users who are self-hosting Formbricks using our one-click setup. If you are using a different setup, you might adjust the commands accordingly.
|
|
|
|
To run all these steps, please navigate to the `formbricks` folder where your `docker-compose.yml` file is located.
|
|
|
|
1. **Backup your Database**: This is a crucial step. Please make sure to backup your database before proceeding with the upgrade. You can use the following command to backup your database:
|
|
|
|
<Col>
|
|
<CodeGroup title="Backup Postgres">
|
|
|
|
```bash
|
|
docker exec formbricks-postgres-1 pg_dump -Fc -U postgres -d formbricks > formbricks_pre_v2.1_$(date +%Y%m%d_%H%M%S).dump
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
<Note>
|
|
If you run into “No such container”, use `docker ps` to find your container name, e.g.
|
|
`formbricks_postgres_1`.
|
|
</Note>
|
|
|
|
<Note>
|
|
If you prefer storing the backup as an `*.sql` file remove the `-Fc` (custom format) option. In case of a
|
|
restore scenario you will need to use `psql` then with an empty `formbricks` database.
|
|
</Note>
|
|
|
|
2. Pull the latest version of Formbricks:
|
|
|
|
<Col>
|
|
<CodeGroup title="Stop the containers">
|
|
|
|
```bash
|
|
docker compose pull
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
3. Stop the running Formbricks instance & remove the related containers:
|
|
|
|
<Col>
|
|
<CodeGroup title="Stop the containers">
|
|
|
|
```bash
|
|
docker compose down
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
4. Restarting the containers with the latest version of Formbricks:
|
|
|
|
<Col>
|
|
<CodeGroup title="Restart the containers">
|
|
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
5. Now let's migrate the data to the latest schema:
|
|
|
|
<Note>To find your Docker Network name for your Postgres Database, find it using `docker network ls`</Note>
|
|
|
|
<Col>
|
|
<CodeGroup title="Migrate the data">
|
|
|
|
```bash
|
|
docker pull ghcr.io/formbricks/data-migrations:v2.1.0 && \
|
|
docker run --rm \
|
|
--network=formbricks_default \
|
|
-e DATABASE_URL="postgresql://postgres:postgres@postgres:5432/formbricks?schema=public" \
|
|
-e UPGRADE_TO_VERSION="v2.1" \
|
|
ghcr.io/formbricks/data-migrations:v2.1.0
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
The above command will migrate your data to the latest schema. This is a crucial step to migrate your existing data to the new structure. Only if the script runs successful, changes are made to the database. The script can safely run multiple times.
|
|
|
|
6. That's it! Once the migration is complete, you can **now access your Formbricks instance** at the same URL as before.
|
|
|
|
### Changes in Environment Variables
|
|
|
|
- `SIGNUP_DISABLED` is now deprecated since self-hosting instaces have signup disabled by default and new users can only be invited by the organization owner or admin.
|
|
- `DEFAULT_TEAM_ID` got renamed to `DEFAULT_ORGANIZATION_ID`
|
|
- `DEFAULT_TEAM_ROLE` got renamed to `DEFAULT_ORGANIZATION_ROLE`
|
|
|
|
## v2.0
|
|
|
|
Formbricks v2.0 comes with huge features such as Multi-Language Surveys and Advanced Styling for Surveys. We have also shipped various optimisations, bug fixes & smaller fixes on the way to make your experience more seamless. This guide will help you migrate your existing Formbricks instance to v2.0 without any hassles or build errors.
|
|
|
|
<Note>
|
|
This upgrade requires a **data migration**. Please make sure to backup your database before proceeding with
|
|
the upgrade. Follow the below steps thoroughly to upgrade your Formbricks instance to v2.0.
|
|
</Note>
|
|
|
|
<Note>
|
|
If you've used the Formbricks Enterprise Edition with a free beta license key, your instance will be
|
|
downgraded to the Community Edition 2.0. You find all license details on the [license
|
|
page.](/self-hosting/license/)
|
|
</Note>
|
|
|
|
<Note>
|
|
We are moving from DockerHub to Github Packages for our images. If you are still pulling the images from
|
|
DockerHub please change `image: formbricks/formbricks:latest` to
|
|
`image:ghcr.io/formbricks/formbricks:latest` in your `docker-compose.yml` file.
|
|
</Note>
|
|
|
|
### Steps to Migrate
|
|
|
|
This guide is for users who are self-hosting Formbricks using our one-click setup. If you are using a different setup, you might adjust the commands accordingly.
|
|
|
|
To run all these steps, please navigate to the `formbricks` folder where your `docker-compose.yml` file is located.
|
|
|
|
1. **Backup your Database**: This is a crucial step. Please make sure to backup your database before proceeding with the upgrade. You can use the following command to backup your database:
|
|
|
|
<Col>
|
|
<CodeGroup title="Backup Postgres">
|
|
|
|
```bash
|
|
docker exec formbricks-postgres-1 pg_dump -Fc -U postgres -d formbricks > formbricks_pre_v2.0_$(date +%Y%m%d_%H%M%S).dump
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
<Note>
|
|
If you run into “No such container”, use `docker ps` to find your container name, e.g.
|
|
`formbricks_postgres_1`.
|
|
</Note>
|
|
|
|
<Note>
|
|
If you prefer storing the backup as an `*.sql` file remove the `-Fc` (custom format) option. In case of a
|
|
restore scenario you will need to use `psql` then with an empty `formbricks` database.
|
|
</Note>
|
|
|
|
2. Pull the latest version of Formbricks:
|
|
|
|
<Col>
|
|
<CodeGroup title="Stop the containers">
|
|
|
|
```bash
|
|
docker compose pull
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
3. Stop the running Formbricks instance & remove the related containers:
|
|
|
|
<Col>
|
|
<CodeGroup title="Stop the containers">
|
|
|
|
```bash
|
|
docker compose down
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
4. Restarting the containers with the latest version of Formbricks:
|
|
|
|
<Col>
|
|
<CodeGroup title="Restart the containers">
|
|
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
5. Now let's migrate the data to the latest schema:
|
|
|
|
<Note>To find your Docker Network name for your Postgres Database, find it using `docker network ls`</Note>
|
|
|
|
<Col>
|
|
<CodeGroup title="Migrate the data">
|
|
|
|
```bash
|
|
docker pull ghcr.io/formbricks/data-migrations:v2.0.3 && \
|
|
docker run --rm \
|
|
--network=formbricks_default \
|
|
-e DATABASE_URL="postgresql://postgres:postgres@postgres:5432/formbricks?schema=public" \
|
|
-e UPGRADE_TO_VERSION="v2.0" \
|
|
ghcr.io/formbricks/data-migrations:v2.0.3
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
The above command will migrate your data to the latest schema. This is a crucial step to migrate your existing data to the new structure. Only if the script runs successful, changes are made to the database. The script can safely run multiple times.
|
|
|
|
6. That's it! Once the migration is complete, you can **now access your Formbricks instance** at the same URL as before.
|
|
|
|
### App Surveys with @formbricks/js
|
|
|
|
From this upgrade, we now **dynamically fetch** the package from our API endpoint and updated the package entrypoints to support both app and website surveys so that you always have the latest version of the package (v2.0.0+).
|
|
|
|
**Old approach:** (v1.6.5)
|
|
|
|
<Col>
|
|
<CodeGroup title="Old Formbricks/js use">
|
|
|
|
```ts
|
|
import formbricks from "@formbricks/js";
|
|
|
|
formbricks.init({
|
|
environmentId: "<environment-id>",
|
|
apiHost: "<api-host>",
|
|
userId: "<user-id>", // optional
|
|
});
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
**New approach:** (v2.0.0)
|
|
|
|
Website surveys:
|
|
|
|
<Col>
|
|
<CodeGroup title="New Formbricks/js website sdk">
|
|
|
|
```ts
|
|
import formbricks from "@formbricks/js/website";
|
|
|
|
formbricks.init({
|
|
environmentId: "<environment-id>",
|
|
apiHost: "<api-host>",
|
|
// userId is not supported here
|
|
});
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
App surveys:
|
|
|
|
<Col>
|
|
<CodeGroup title="New Formbricks/js app sdk">
|
|
|
|
```ts
|
|
import formbricks from "@formbricks/js/app";
|
|
|
|
formbricks.init({
|
|
environmentId: "<environment-id>",
|
|
apiHost: "<api-host>",
|
|
userId: "<user-id>", // required
|
|
});
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
## v1.6
|
|
|
|
Formbricks v1.6 comes with a big new features like Advanced Targeting & Segmentation of your end-users along with on-the-fly triggers for surveys and a ton of stability improvements & features. This also involves a few changes in our environment variables. This guide will help you migrate your existing Formbricks instance to v1.6 without any hassles or build errors.
|
|
|
|
<Note>
|
|
This upgrade requires a **data migration**. Please make sure to backup your database before proceeding with
|
|
the upgrade. Follow the below steps thoroughly to upgrade your Formbricks instance to v1.6.
|
|
</Note>
|
|
|
|
### Steps to Migrate
|
|
|
|
This guide is for users who are self-hosting Formbricks using our one-click setup. If you are using a different setup, you might adjust the commands accordingly.
|
|
|
|
To run all these steps, please navigate to the `formbricks` folder where your `docker-compose.yml` file is located.
|
|
|
|
1. **Backup your Database**: This is a crucial step. Please make sure to backup your database before proceeding with the upgrade. You can use the following command to backup your database:
|
|
|
|
<Col>
|
|
<CodeGroup title="Backup Postgres">
|
|
|
|
```bash
|
|
docker exec formbricks-quickstart-postgres-1 pg_dump -Fc -U postgres -d formbricks > formbricks_pre_v1.6_$(date +%Y%m%d_%H%M%S).dump
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
<Note>
|
|
If you run into “No such container”, use `docker ps` to find your container name, e.g.
|
|
`formbricks_postgres_1`.
|
|
</Note>
|
|
|
|
<Note>
|
|
If you prefer storing the backup as an `*.sql` file remove the `-Fc` (custom format) option. In case of a
|
|
restore scenario you will need to use `psql` then with an empty `formbricks` database.
|
|
</Note>
|
|
|
|
2. Stop the running Formbricks instance & remove the related containers:
|
|
|
|
<Col>
|
|
<CodeGroup title="Stop the containers">
|
|
|
|
```bash
|
|
docker compose down
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
3. Restarting the containers will automatically pull the latest version of Formbricks:
|
|
|
|
<Col>
|
|
<CodeGroup title="Restart the containers">
|
|
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
4. Now let's migrate the data to the latest schema:
|
|
|
|
<Note>To find your Docker Network name for your Postgres Database, find it using `docker network ps`</Note>
|
|
|
|
<Col>
|
|
<CodeGroup title="Migrate the data">
|
|
|
|
```bash
|
|
docker run --rm \
|
|
--network=formbricks_default \
|
|
-e DATABASE_URL="postgresql://postgres:postgres@postgres:5432/formbricks?schema=public" \
|
|
-e UPGRADE_TO_VERSION="v1.6" \
|
|
ghcr.io/formbricks/data-migrations:v1.6.1
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
The above command will migrate your data to the latest schema. This is a crucial step to migrate your existing data to the new structure. Only if the script runs successful, changes are made to the database. The script can safely run multiple times.
|
|
|
|
5. That's it! Once the migration is complete, you can **now access your Formbricks instance** at the same URL as before.
|
|
|
|
#### Restoring the database after a failed upgrade
|
|
|
|
<Col>
|
|
<CodeGroup title="Restore the database">
|
|
|
|
```bash
|
|
docker exec -i formbricks-quickstart-postgres-1 pg_restore --clean -U postgres -v -d formbricks < formbricks_pre_v1.6_<timestamp_of_your_dump_file>.dump
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
<Note>Replace the path to `formbricks_pre_v1.6_<timestamp_of_your_dump_file>.dump` with the exact path to your `.dump` file.</Note>
|
|
|
|
<Note>This will wipe the database and restore from the `.dump` file</Note>
|
|
|
|
### App Surveys with @formbricks/js
|
|
|
|
If you are using the `@formbricks/js` package, please make sure to update it to version `~1.6.5` to use the latest features and improvements.
|
|
|
|
<Note>
|
|
Currently the package needs to be pinned to `~1.6.5`, see
|
|
https://github.com/formbricks/formbricks/issues/2273
|
|
</Note>
|
|
|
|
<Col>
|
|
<CodeGroup title="Upgrade and pin the client package">
|
|
|
|
```bash
|
|
npm install @formbricks/js@~1.6.5
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
### Deprecated Environment Variables
|
|
|
|
| Environment Variable | Comments |
|
|
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
| GITHUB_AUTH_ENABLED | Was used to enable GitHub OAuth, but from v1.6, you can just set the `GITHUB_ID` and `GITHUB_SECRET` environment variables. |
|
|
| GOOGLE_AUTH_ENABLED | Was used to enable Google OAuth, but from v1.6, you can just set the `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` environment variables. |
|
|
| AZUREAD_AUTH_ENABLED | Was used to enable AzureAD OAuth, but from v1.6, you can just set the `AZUREAD_CLIENT_ID`, `AZUREAD_CLIENT_SECRET` & `AZUREAD_TENANT_ID` environment variables. |
|
|
|
|
## v1.2
|
|
|
|
Formbricks v1.2 ships a lot of features targeting our Link Surveys. We have also improved our security posture to be as robust as ever. However, it also comes with a few breaking changes specifically with the environment variables. This guide will help you migrate your existing Formbricks instance to v1.2 without any hassles or build errors.
|
|
|
|
### New Environment Variables
|
|
|
|
| Environment Variable | Required | Recommended Generation | Comments |
|
|
| -------------------- | -------- | ----------------------- | ----------------------------------------------------------- |
|
|
| ENCRYPTION_KEY | true | `openssl rand -hex 32` | Needed for 2 Factor Authentication |
|
|
| SHORT_URL_BASE | false | `<your-short-base-url>` | Needed if you want to enable shorter links for Link Surveys |
|
|
|
|
### Deprecated / Removed Environment Variables
|
|
|
|
| Environment Variable | Comments |
|
|
| -------------------- | ------------------------------------------------------------------------- |
|
|
| SURVEY_BASE_URL | The WEBAPP_URL is now used to determine the survey base url in all places |
|
|
|
|
## v1.1
|
|
|
|
Formbricks v1.1 includes a lot of new features and improvements. However, it also comes with a few breaking changes specifically with the environment variables. This guide will help you migrate your existing Formbricks instance to v1.1 without losing any data.
|
|
|
|
### Renamed Environment Variables
|
|
|
|
This was introduced because we got a lot of requests from our users for the ability to define some common environment variables at runtime itself i.e. without having to rebuild the image for the changes to take effect.
|
|
This is now possible with v1.1. However, due to Next.JS best practices, we had to deprecate the prefix **NEXT*PUBLIC*** in the following environment variables:
|
|
|
|
| till v1.0 | v1.1 |
|
|
| --------------------------------------- | --------------------------- |
|
|
| NEXT_PUBLIC_EMAIL_VERIFICATION_DISABLED | EMAIL_VERIFICATION_DISABLED |
|
|
| NEXT_PUBLIC_PASSWORD_RESET_DISABLED | PASSWORD_RESET_DISABLED |
|
|
| NEXT_PUBLIC_SIGNUP_DISABLED | SIGNUP_DISABLED |
|
|
| NEXT_PUBLIC_INVITE_DISABLED | INVITE_DISABLED |
|
|
| NEXT_PUBLIC_PRIVACY_URL | PRIVACY_URL |
|
|
| NEXT_PUBLIC_TERMS_URL | TERMS_URL |
|
|
| NEXT_PUBLIC_IMPRINT_URL | IMPRINT_URL |
|
|
| NEXT_PUBLIC_GITHUB_AUTH_ENABLED | GITHUB_AUTH_ENABLED |
|
|
| NEXT_PUBLIC_GOOGLE_AUTH_ENABLED | GOOGLE_AUTH_ENABLED |
|
|
| NEXT_PUBLIC_WEBAPP_URL | WEBAPP_URL |
|
|
| NEXT_PUBLIC_IS_FORMBRICKS_CLOUD | IS_FORMBRICKS_CLOUD |
|
|
| NEXT_PUBLIC_SURVEY_BASE_URL | SURVEY_BASE_URL |
|
|
|
|
<Note>
|
|
Please note that their values and the logic remains exactly the same. Only the prefix has been deprecated.
|
|
The other environment variables remain the same as well.
|
|
</Note>
|
|
|
|
### Deprecated Environment Variables
|
|
|
|
- **NEXT_PUBLIC_VERCEL_URL**: Was used as Vercel URL (used instead of WEBAPP_URL), but from v1.1, you can just set the WEBAPP_URL environment variable to your Vercel URL.
|
|
- **RAILWAY_STATIC_URL**: Was used as Railway Static URL (used instead of WEBAPP_URL), but from v1.1, you can just set the WEBAPP_URL environment variable.
|
|
- **RENDER_EXTERNAL_URL**: Was used as an external URL to Render (used instead of WEBAPP_URL), but from v1.1, you can just set the WEBAPP_URL environment variable.
|
|
- **HEROKU_APP_NAME**: Was used to build the App name on a Heroku hosted webapp, but from v1.1, you can just set the WEBAPP_URL environment variable.
|
|
- **NEXT_PUBLIC_WEBAPP_URL**: Was used for the same purpose as WEBAPP_URL, but from v1.1, you can just set the WEBAPP_URL environment variable.
|
|
- **PRISMA_GENERATE_DATAPROXY**: Was used to tell Prisma that it should generate the runtime for Dataproxy usage. But its officially deprecated now.
|
|
|
|
### Helper Shell Script
|
|
|
|
For a seamless migration, below is a shell script for your self-hosted instance that will automatically update your environment variables to be compliant with the new naming conventions.
|
|
|
|
### Docker & Single Script Setup
|
|
|
|
Now that these variables can be defined at runtime, you can append them inside your `x-environment` in the `docker-compose.yml` itself.
|
|
For a more detailed guide on these environment variables, please refer to the [Important Runtime Variables](/self-hosting/docker#important-run-time-variables) section.
|
|
|
|
<Col>
|
|
<CodeGroup title="docker-compose.yml">
|
|
|
|
```yaml {{ title: 'docker-compose.yml' }}
|
|
version: "3.3"
|
|
x-environment: &environment
|
|
environment:
|
|
# The url of your Formbricks instance used in the admin panel
|
|
WEBAPP_URL:
|
|
|
|
# Required for next-auth. Should be the same as WEBAPP_URL
|
|
NEXTAUTH_URL:
|
|
|
|
# PostgreSQL DB for Formbricks to connect to
|
|
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/formbricks?schema=public"
|
|
|
|
# NextJS Auth
|
|
# @see: https://next-auth.js.org/configuration/options#nextauth_secret
|
|
# You can use: `openssl rand -hex 32` to generate one
|
|
NEXTAUTH_SECRET:
|
|
|
|
# PostgreSQL password
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
# Email Configuration
|
|
MAIL_FROM:
|
|
SMTP_HOST:
|
|
SMTP_PORT:
|
|
SMTP_SECURE_ENABLED:
|
|
SMTP_USER:
|
|
SMTP_PASSWORD:
|
|
|
|
# Uncomment the below and set it to 1 to disable Email Verification for new signups
|
|
# EMAIL_VERIFICATION_DISABLED:
|
|
|
|
# Uncomment the below and set it to 1 to disable Password Reset
|
|
# PASSWORD_RESET_DISABLED:
|
|
|
|
# Uncomment the below and set it to 1 to disable Signups
|
|
# SIGNUP_DISABLED:
|
|
|
|
# Uncomment the below and set it to 1 to disable loging in with email
|
|
# EMAIL_AUTH_DISABLED:
|
|
|
|
# Uncomment the below and set it to 1 to disable Invites
|
|
# INVITE_DISABLED:
|
|
|
|
# Uncomment the below and set a value to have your own Privacy Page URL on the signup & login page
|
|
# PRIVACY_URL:
|
|
|
|
# Uncomment the below and set a value to have your own Terms Page URL on the auth and the surveys page
|
|
# TERMS_URL:
|
|
|
|
# Uncomment the below and set a value to have your own Imprint Page URL on the auth and the surveys page
|
|
# IMPRINT_URL:
|
|
|
|
# Uncomment the below and set to 1 if you want to enable GitHub OAuth
|
|
# GITHUB_AUTH_ENABLED:
|
|
# GITHUB_ID:
|
|
# GITHUB_SECRET:
|
|
|
|
# Uncomment the below and set to 1 if you want to enable Google OAuth
|
|
# GOOGLE_AUTH_ENABLED:
|
|
# GOOGLE_CLIENT_ID:
|
|
# GOOGLE_CLIENT_SECRET:
|
|
```
|
|
|
|
</CodeGroup>
|
|
</Col>
|
|
|
|
Did we miss something? Are you still facing issues migrating your app? [Join our Discord!](https://formbricks.com/discord) We'd be happy to help!
|