umami-software / migrate-v1-v2

Script for migrating data from Umami v1 to v2
MIT License
1 stars 7 forks source link

✗ Failed to run sql file /db/postgresql/data-migration-v2.sql #7

Closed candidexmedia closed 9 months ago

candidexmedia commented 10 months ago

Hi! I'm attempting to migrate my v1 Supabase database to v2, via a Vercel deployment.

I'm not sure if I understand how or where to use the install command:

git clone https://github.com/umami-software/migrate-v1-v2.git
cd migrate-v1-v2
yarn install
yarn build
candidexmedia commented 10 months ago

Okay, I managed to figure out that I had to run those command locally on my PC.

Unfortunately, I ran into the following error(s):

yarn start
yarn run v1.22.10
$ node index.js
Running v0.15.0
✓ DATABASE_URL is defined.
✓ Database connection successful.
✓ Database v1 tables ready for migration.
✓ Database v2 tables found.
✓ Database is ready for migration.
✓ Starting v2 data migration. Please do no cancel this process, it may take a while.
PrismaClientKnownRequestError:
Invalid `prisma.$executeRawUnsafe()` invocation:

Raw query failed. Code: `42703`. Message: `column e.event_name does not exist`
    at Zr.handleRequestError (C:\.....\migrate-v1-v2\node_modules\@prisma\client\runtime\library.js:171:6414)
    at Zr.handleAndLogRequestError (C:\.....\migrate-v1-v2\node_modules\@prisma\client\runtime\library.js:171:5948)
    at Zr.request (C:\.....\migrate-v1-v2\node_modules\@prisma\client\runtime\library.js:171:5786)
    at async Proxy._request (C:\.....\migrate-v1-v2\node_modules\@prisma\client\runtime\library.js:174:10455)
    at async runSqlFile (C:\.....\migrate-v1-v2\index.js:277:9)
    at async migrateData (C:\.....\migrate-v1-v2\index.js:109:3)
    at async C:\.....\migrate-v1-v2\index.js:308:7 {
  code: 'P2010',
  clientVersion: '4.11.0',
  meta: { code: '42703', message: 'column e.event_name does not exist' }
}
✗ Failed to run sql file /db/postgresql/data-migration-v2.sql.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
candidexmedia commented 9 months ago

Turns out, I had to create a column in v1_event called "event_name", and run yarn start again