How can sentry upgrade with existing mysql instance

We want to install sentry using docker, but we want to directly use an existing mysql instance on another server, I tried to run sentry upgrade with sentry.conf.py with mysql connection settings, but it does not seem to work.
I search for the problem only get that the latest version of sentry will not support migrate on mysql.
So, is that true I just can’t use an existing mysql or redis when install with docker?

That’s correct. Redis data would be fine, but you’ll need to dump the database from MySQL and load it into a PostgreSQL db. There are definitely tools out there to do that pretty easily.

Thanks for your reply, but what if just use mysql as our db, when install using docker, how can we initial the mysql db? I also tried login into the docker by executing: SENTRY_CONF=/etc/sentry sentry upgrade, but it seems also try to connect to the local postgres, this is the error trace:

root@c29f6c6a4c92:/usr/src/sentry# SENTRY_CONF=/etc/sentry sentry upgrade
Syncing…
Traceback (most recent call last):
File “/usr/local/bin/sentry”, line 11, in
sys.exit(main())
File “/usr/local/lib/python2.7/site-packages/sentry/runner/init.py”, line 158, in main
cli(prog_name=get_prog(), obj={}, max_content_width=100)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/sentry/runner/decorators.py”, line 36, in inner
return ctx.invoke(f, *args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/sentry/runner/commands/upgrade.py”, line 60, in upgrade
_upgrade(not noinput, traceback, verbosity, not no_repair)
File “/usr/local/lib/python2.7/site-packages/sentry/runner/commands/upgrade.py”, line 20, in _upgrade
verbosity=verbosity,
File “/usr/local/lib/python2.7/site-packages/django/core/management/init.py”, line 159, in call_command
return klass.execute(*args, **defaults)
File “/usr/local/lib/python2.7/site-packages/django/core/management/base.py”, line 285, in execute
output = self.handle(*args, **options)
File “/usr/local/lib/python2.7/site-packages/django/core/management/base.py”, line 415, in handle
return self.handle_noargs(**options)
File “/usr/local/lib/python2.7/site-packages/south/management/commands/syncdb.py”, line 92, in handle_noargs
syncdb.Command().execute(**options)
File “/usr/local/lib/python2.7/site-packages/django/core/management/base.py”, line 285, in execute
output = self.handle(*args, **options)
File “/usr/local/lib/python2.7/site-packages/django/core/management/base.py”, line 415, in handle
return self.handle_noargs(**options)
File “/usr/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py”, line 57, in handle_noargs
cursor = connection.cursor()
File “/usr/local/lib/python2.7/site-packages/django/db/backends/init.py”, line 162, in cursor
cursor = util.CursorWrapper(self._cursor(), self)
File “/usr/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py”, line 42, in inner
return func(self, *args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/sentry/db/postgres/base.py”, line 60, in _cursor
cursor = super(DatabaseWrapper, self)._cursor()
File “/usr/local/lib/python2.7/site-packages/django/db/backends/init.py”, line 132, in _cursor
self.ensure_connection()
File “/usr/local/lib/python2.7/site-packages/django/db/backends/init.py”, line 127, in ensure_connection
self.connect()
File “/usr/local/lib/python2.7/site-packages/django/db/utils.py”, line 99, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File “/usr/local/lib/python2.7/site-packages/django/db/backends/init.py”, line 127, in ensure_connection
self.connect()
File “/usr/local/lib/python2.7/site-packages/django/db/backends/init.py”, line 115, in connect
self.connection = self.get_new_connection(conn_params)
File “/usr/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py”, line 115, in get_new_connection
return Database.connect(**conn_params)
File “/usr/local/lib/python2.7/site-packages/psycopg2/init.py”, line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
django.db.utils.OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?

this is the mysql connection settings in /etc/sentry/sentry.config.py in docker:

postgres = env(‘SENTRY_POSTGRES_HOST’) or (env(‘POSTGRES_PORT_5432_TCP_ADDR’) and ‘postgres’)
if postgres:
DATABASES = {
‘default’: {
‘ENGINE’: ‘django.db.backends.mysql’,
‘NAME’: ‘sentry_pat’,
‘USER’: ‘sentry_pat’,

I think I get the problem, because I still use the postgres config in sentry.python.py, just delete and use mysql directly, and thanks again for your advise, I’ll use the tool when we want migrate to postgres.

delete this solved my problem:

postgres = env(‘SENTRY_POSTGRES_HOST’) or (env(‘POSTGRES_PORT_5432_TCP_ADDR’) and ‘postgres’)