self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

Migrate data from a single org deployment of Sentry to a multi-org one

Open mic4ael opened this issue 3 years ago • 10 comments

Problem Statement

Is it possible to migrate data from completely separate single-org Sentry instances into a single, multi-org Sentry deployment? I checked sentry export and sentry import commands but they seem to work nicely only with single-org deployments.

Solution Brainstorm

No response

mic4ael avatar Mar 30 '22 13:03 mic4ael

The problem is that we have created (at CERN) several instances of Sentry 9 for different projects. Now, while preparing for the upgrade to Sentry 20.x we have noticed a drastic increase in the resources that a single instance of Sentry requires for proper operation. Therefore, we thought that maybe migrating all these instances into separate organizations within a single Sentry deployment would be much more efficient. But the problem is that I can't find a way to migrate data between Sentry deployments in such case.

mic4ael avatar Mar 30 '22 13:03 mic4ael

Hrm, your use case seems reasonable but yes, I'm not surprised that you've found the import/export commands to be designed for one-to-one. Have you scoped out what it would take to modify these commands?

chadwhitacre avatar Mar 30 '22 19:03 chadwhitacre

Hrm, your use case seems reasonable but yes, I'm not surprised that you've found the import/export commands to be designed for one-to-one. Have you scoped out what it would take to modify these commands?

Yup. Had a quick look at the export command (https://github.com/getsentry/sentry/blob/master/src/sentry/runner/commands/backup.py#L126=) and maybe one option would be to simply exclude SentryOrg model from the final export? However, does the import command preserve primary keys etc? If not, then maybe export/import workflow shoud suffice in the end.

mic4ael avatar Mar 31 '22 06:03 mic4ael

@chadwhitacre what do you think? ;)

mic4ael avatar Apr 04 '22 05:04 mic4ael

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Apr 26 '22 00:04 github-actions[bot]

@chadwhitacre any feedback on this?

mic4ael avatar Apr 27 '22 06:04 mic4ael

My use-case is very similar in that I have several instances of Sentry and would like to combine them into one multi-org instance of Sentry.

AndrewMoyse avatar Apr 27 '22 23:04 AndrewMoyse

In general our import/export code is under-maintained. I'm putting this on the backlog so stalebot leaves it alone. I want to get to this but can't promise when. If you all make progress keep us posted! 🐭

chadwhitacre avatar Apr 29 '22 18:04 chadwhitacre