Script for migrating data from Umami v1 to v2.
- Database schema must be in sync with the latest v1 Umami repo. The script will query the prisma migrations table to ensure the latest migrations have been ran.
- Backup your target database prior to use. Potential data loss may occur if the migration is interrupted.
- For users with larger datasets (5M+), the migration may take while. Please plan accordingly.
- The script will NOT migrate any event data into v2.
- The script will ask you if you want to drop your v1 tables after the migration is complete.
- If an
event_data
table is found populated with data, it will be renamed tov1_event_data
but not dropped.
There are two ways to run the migration script.
cd umami
yarn add @umami/migrate-v1-v2
npx @umami/migrate-v1-v2
git clone https://github.com/umami-software/migrate-v1-v2.git
cd migrate-v1-v2
yarn install
yarn build
Create an .env
file with the following variable defined:
DATABASE_URL={connection url}
yarn start
- If your
DATABASE_URL
is localhost and the migration can't connect to the database, try changing to an IP address, for example:127.0.0.1
.