Self-Hosting
Migration Guide
v2.5
Formbricks v2.5 allows you to visualize responses in a data table format. This release also includes a few bug fixes and performance improvements.
This release will fix the inconsistency of CTA and consent question values in case of skipping the question. The value will be set to empty string instead of "dismissed" in order to make it consistent with other questions.
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.
- 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:
Backup Postgres
docker exec formbricks-postgres-1 pg_dump -Fc -U postgres -d formbricks > formbricks_pre_v2.5_$(date +%Y%m%d_%H%M%S).dump
If you run into “No such container”, use docker ps
to find your container name, e.g.
formbricks_postgres_1
.
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.
- Pull the latest version of Formbricks:
Stop the containers
docker compose pull
- Stop the running Formbricks instance & remove the related containers:
Stop the containers
docker compose down
- Restarting the containers with the latest version of Formbricks:
Restart the containers
docker compose up -d
- Now let's migrate the data to the latest schema:
docker network ls
Migrate the data
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.5" \
ghcr.io/formbricks/data-migrations:latest
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.
- That's it! Once the migration is complete, you can now access your Formbricks instance at the same URL as before.
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.
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.
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.
- 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:
Backup Postgres
docker exec formbricks-postgres-1 pg_dump -Fc -U postgres -d formbricks > formbricks_pre_v2.4_$(date +%Y%m%d_%H%M%S).dump
If you run into “No such container”, use docker ps
to find your container name, e.g.
formbricks_postgres_1
.
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.
- Pull the latest version of Formbricks:
Stop the containers
docker compose pull
- Stop the running Formbricks instance & remove the related containers:
Stop the containers
docker compose down
- Restarting the containers with the latest version of Formbricks:
Restart the containers
docker compose up -d
- Now let's migrate the data to the latest schema:
docker network ls
Migrate the data
docker pull ghcr.io/formbricks/data-migrations:v2.4.0 && \
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:v2.4.0
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.
- 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 useopenssl 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
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.
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.
- 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:
Backup Postgres
docker exec formbricks-postgres-1 pg_dump -Fc -U postgres -d formbricks > formbricks_pre_v2.3_$(date +%Y%m%d_%H%M%S).dump
If you run into “No such container”, use docker ps
to find your container name, e.g.
formbricks_postgres_1
.
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.
- Pull the latest version of Formbricks:
Stop the containers
docker compose pull
- Stop the running Formbricks instance & remove the related containers:
Stop the containers
docker compose down
- Restarting the containers with the latest version of Formbricks:
Restart the containers
docker compose up -d
- Now let's migrate the data to the latest schema:
docker network ls
Migrate the data
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
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.
- 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.
- 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:
Backup Postgres
docker exec formbricks-postgres-1 pg_dump -Fc -U postgres -d formbricks > formbricks_pre_v2.2_$(date +%Y%m%d_%H%M%S).dump
If you run into “No such container”, use docker ps
to find your container name, e.g.
formbricks_postgres_1
.
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.
- Pull the latest version of Formbricks:
Stop the containers
docker compose pull
- Stop the running Formbricks instance & remove the related containers:
Stop the containers
docker compose down
- Restarting the containers with the latest version of Formbricks:
Restart the containers
docker compose up -d
- Now let's migrate the data to the latest schema:
docker network ls
Migrate the data
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
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.
- 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.
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.
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.
- 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:
Backup Postgres
docker exec formbricks-postgres-1 pg_dump -Fc -U postgres -d formbricks > formbricks_pre_v2.1_$(date +%Y%m%d_%H%M%S).dump
If you run into “No such container”, use docker ps
to find your container name, e.g.
formbricks_postgres_1
.
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.
- Pull the latest version of Formbricks:
Stop the containers
docker compose pull
- Stop the running Formbricks instance & remove the related containers:
Stop the containers
docker compose down
- Restarting the containers with the latest version of Formbricks:
Restart the containers
docker compose up -d
- Now let's migrate the data to the latest schema:
docker network ls
Migrate the data
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
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.
- 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 toDEFAULT_ORGANIZATION_ID
DEFAULT_TEAM_ROLE
got renamed toDEFAULT_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.
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.
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.
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.
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.
- 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:
Backup Postgres
docker exec formbricks-postgres-1 pg_dump -Fc -U postgres -d formbricks > formbricks_pre_v2.0_$(date +%Y%m%d_%H%M%S).dump
If you run into “No such container”, use docker ps
to find your container name, e.g.
formbricks_postgres_1
.
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.
- Pull the latest version of Formbricks:
Stop the containers
docker compose pull
- Stop the running Formbricks instance & remove the related containers:
Stop the containers
docker compose down
- Restarting the containers with the latest version of Formbricks:
Restart the containers
docker compose up -d
- Now let's migrate the data to the latest schema:
docker network ls
Migrate the data
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
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.
- 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)
Old Formbricks/js use
import formbricks from "@formbricks/js";
formbricks.init({
environmentId: "<environment-id>",
apiHost: "<api-host>",
userId: "<user-id>", // optional
});
New approach: (v2.0.0)
Website surveys:
New Formbricks/js website sdk
import formbricks from "@formbricks/js/website";
formbricks.init({
environmentId: "<environment-id>",
apiHost: "<api-host>",
// userId is not supported here
});
App surveys:
New Formbricks/js app sdk
import formbricks from "@formbricks/js/app";
formbricks.init({
environmentId: "<environment-id>",
apiHost: "<api-host>",
userId: "<user-id>", // required
});
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.
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.
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.
- 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:
Backup Postgres
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
If you run into “No such container”, use docker ps
to find your container name, e.g.
formbricks_postgres_1
.
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.
- Stop the running Formbricks instance & remove the related containers:
Stop the containers
docker compose down
- Restarting the containers will automatically pull the latest version of Formbricks:
Restart the containers
docker compose up -d
- Now let's migrate the data to the latest schema:
docker network ps
Migrate the data
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
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.
- 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
Restore the database
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
formbricks_pre_v1.6_<timestamp_of_your_dump_file>.dump
with the exact path to your .dump
file..dump
fileApp 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.
Currently the package needs to be pinned to ~1.6.5
, see
https://github.com/formbricks/formbricks/issues/2273
Upgrade and pin the client package
npm install @formbricks/js@~1.6.5
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 NEXTPUBLIC 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 |
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.
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 section.
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:
Did we miss something? Are you still facing issues migrating your app? Join our Discord! We'd be happy to help!