How are you running Sentry?
I followed the migration guide, alongside all fixes and workaround and managed to get to the actual migration routine. Sentry tries to process all existing postgres events but fails to (for every event):
An error occured while trying to instert the following event: <sentry.eventstore.models.Event object at 0x7f2f08e552d0>
.----
insert() takes at least 8 arguments (8 given)
[...]
Event migration done. Migrated 0 of 197988 events.
install.sh etc.Migration scripts succeeds and I have all event data in the new version.
Error message suggests a syntax error?
This is the culprit: #17021 //cc @tkaemming
Working on a fix.
Nice! How would I re-apply the specific migration which backfills the eventstream?
I tried django migrate sentry 0024_auto_20191230_2052, but this will fail due to foreign key constraints / missing tables when rolling back to this migration.
@buffcode I think you can try django migrate sentry 0024_auto_20191230_2052 --fake?
Yeah this seems like the way forward: https://stackoverflow.com/a/31953632/90297~~
Old code
docker-compose run --rm web django migrate --fake sentry 0023_hide_environment_none_20191126
docker-compose run --rm web upgrade
@buffcode I fear I have bad news for you if you don't have a back up of your old DB. There is a way to reapply this migration but since 0027 drops the table that events are stored, even if you go back, you cannot get the event data back :(
I can confirm that with these fixes I was able to import existing data from 9.1.2 / Postgres 9.5 into Sentry 10.
Thanks alot!
Thank _you_ for the report @buffcode and sorry for the disruption we caused. We've added a light protection into the migration and I'm planning to add auto-backup to the install script over at getsentry/onpremise :)
Are these fixes already part of the onpremise update script/docker image? I am currently trying to upgrade from 9.1.2 to 10.x and my Events are still lost.
@cb109 yeah, these are merged to master so you should not have any issues if you are using the latest master of the on-premise repo (and not using a specific SENTRY_IMAGE override)