Hi,

We are hosting our own redash instance (I worked with it in the past - it rocks!)
I’d like to create a daily backup of all the data, so that in the case where we need to re-install the instance, we can just restore it from the backup.

What is the best way to do it?
I noticed that there are numerous api endpoints I can call (/api/[queries|dashboards|…]), but I couldn’t find any documentation for them, it is not clear if I need anything else and how what is the process to restore things with the data I got from the above api.

Thanks,
Yotam.

P.S., btw, the in only reason for us to be using a self-hosted redash is security…

1 Like

Hi!

The easiest way is to take a backup of the Postgres database used for metadata by Redash. This way you get a snapshot of everything and there are standard tools to do this backup.

1 Like

Follow up Question - I tried to back up the DB using pg_dump and It took a lot of time because of the events table (it has 10M rows) and the query_results table(1M rows). can u please elaborate what this data is used for and if it can be purged?

Im a bit stuck here as well. I created all my queries and some dashboards on a vm and now want to move them all to our production machine.

I did: sudo -u redash pg_dump > backup_filename.sql
Then I copied the sql file to the new server - both servers were running the newest and same version of redash.

on the new server I ran: sudo -u redash psql -d redash < backup_filename.sql

There were a lot of errors telling me about access permissions and that things already exist. I still cant see the queries or the dashboards. What am I doing wrong. I realise it’s probably some noob error.

1 Like

events table can be purged / backed up without data (just the structure). query_results needs to be backed up, although you probably don’t need all the 1M rows (only the ones still referenced by queries.latest_query_data_id). There is a cleanup process that runs once a week, you might need to run it more frequently so it can keep up with deleting the unused query results.

Maybe your new server already has database created? Just drop it before trying to restore the old one.

Thank you arikfr. For others like me who want to move all their quires/users/dashboards from one server to a new server this is what I did to get it working after I copied the backup_filename.sql to the new server (im not using a docker version):

first stop everything because you cant drop the db without stopping the services that are using the db:
sudo supervisorctl stop all

then drop the existing redash db (I would probably would make a backup of this before you do it - like you did to backup the other server but call it something else):
sudo -u redash dropdb redash

create an new empty db:
sudo -u postgres createdb redash --owner=redash

replace the db with the sql you took from your other instance
sudo -u redash psql -d redash < backup_filename.sql

restart everything:
sudo supervisorctl restart all

It should be good to go. This works on a clean install where you haven’t set us the server yet and created the admin account. I noticed that on one of the servers that I had created the admin account it was not displaying the new queries (the same email address was used for the admin) - when I checked the .env file there were missing lines (database_url, redis_url, log_level). Once I put them back in and restarted the services it all worked.

1 Like

Hi,

Thanks for the post, it helped me a lot in setting up redash for the first time.

Though I am stuck at this point right now where I am not able to get past my login screen after dumping the old data to new screen.

So now, I am not getting setup redash screen.
instead, I am getting sign in screen and once I put anything and press enter it gives this error:

Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Not sure what am I missing here.

1 Like

I have the same issue of internal server error
i’m using docker images and i tried to backup data of one server (4.0) and move it to another server (6.0)
I follow this instruction with these instructions

but still got server error
could someone suggest a solution ?

Oops, didn’t see this. Did you get it figured out, or do you still need help with it? :smile:

yes, i still need help , thanks

@hananv No worries. :smile:

Are you ok to cut-n-paste the error message for the server here? Also, was the error when you were doing the backup, the upgrade, or starting the server after the upgrade?

@justinclift
logs are long

Redash6 was install via dockers on new computer and i can access to it at test:5000
then i tried to restore DB from another Redash4 DB

hanan@test:~ docker-compose stop Stopping redash_nginx_1 ... done Stopping redash_server_1 ... done Stopping redash_adhoc_worker_1 ... done Stopping redash_scheduled_worker_1 ... done Stopping redash_scheduler_1 ... done Stopping redash_postgres_1 ... done Stopping redash_redis_1 ... done hanan@test:~
hanan@test:~ hanan@test:~
hanan@test:~$ docker inspect --format ‘{{ .NetworkSettings.Networks.redash_default.IPAddress }}’ redash_postgres_1

hanan@test:~ docker start redash_postgres_1 redash_postgres_1 hanan@test:~ docker inspect --format ‘{{ .NetworkSettings.Networks.redash_default.IPAddress }}’ redash_postgres_1
172.18.0.2
hanan@test:~$ psql -h 172.18.0.2 -U postgres postgres < backup.sql
Password for user postgres:
SET
SET
SET
SET
SET
SET
SET
SET
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
DROP TRIGGER
DROP INDEX
DROP INDEX
DROP INDEX
DROP INDEX
DROP INDEX
DROP INDEX
DROP INDEX
DROP INDEX
DROP INDEX
DROP INDEX
DROP INDEX
DROP INDEX
DROP INDEX
DROP INDEX
ALTER TABLE
ALTER TABLE
ERROR: cannot drop constraint users_pkey on table users because other objects depend on it
DETAIL: constraint favorites_user_id_fkey on table favorites depends on index users_pkey
HINT: Use DROP … CASCADE to drop the dependent objects too.
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ERROR: cannot drop constraint organizations_pkey on table organizations because other objects depend on it
DETAIL: constraint favorites_org_id_fkey on table favorites depends on index organizations_pkey
HINT: Use DROP … CASCADE to drop the dependent objects too.
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
ERROR: cannot drop table users because other objects depend on it
DETAIL: constraint favorites_user_id_fkey on table favorites depends on table users
HINT: Use DROP … CASCADE to drop the dependent objects too.
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
ERROR: cannot drop table organizations because other objects depend on it
DETAIL: constraint favorites_org_id_fkey on table favorites depends on table organizations
HINT: Use DROP … CASCADE to drop the dependent objects too.
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
DROP TABLE
DROP SEQUENCE
DROP TABLE
DROP TABLE
DROP SEQUENCE
DROP TABLE
DROP FUNCTION
DROP EXTENSION
ERROR: cannot drop schema public because other objects depend on it
DETAIL: table organizations depends on schema public
table users depends on schema public
table favorites depends on schema public
HINT: Use DROP … CASCADE to drop the dependent objects too.
COMMENT
ERROR: schema “public” already exists
ALTER SCHEMA
COMMENT
CREATE EXTENSION
COMMENT
SET
CREATE FUNCTION
ALTER FUNCTION
SET
SET
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
ERROR: relation “organizations” already exists
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
ERROR: relation “users” already exists
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
COPY 0
setval

  1

(1 row)

COPY 1
COPY 0
setval

  1

(1 row)

COPY 0
setval

  1

(1 row)

COPY 7
setval

  7

(1 row)

COPY 201
setval

201

(1 row)

COPY 18
setval

 18

(1 row)

COPY 2
setval

  2

(1 row)

COPY 1
setval

  1

(1 row)

COPY 28436
setval

28436
(1 row)

COPY 4
setval

  4

(1 row)

COPY 0
setval

  1

(1 row)

COPY 1
setval

  1

(1 row)

COPY 182
setval

182

(1 row)

COPY 349
setval

4666
(1 row)

COPY 0
setval

  1

(1 row)

COPY 39
setval

 39

(1 row)

COPY 247
setval

258

(1 row)

COPY 56
setval

 69

(1 row)

ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ERROR: multiple primary keys for table “organizations” are not allowed
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ERROR: multiple primary keys for table “users” are not allowed
ALTER TABLE
ALTER TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE TRIGGER
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
REVOKE
REVOKE
GRANT
GRANT


server_1 | [2019-03-12 22:06:25,885] ERROR in app: Exception on / [GET]
server_1 | Traceback (most recent call last):
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1988, in wsgi_app
server_1 | response = self.full_dispatch_request()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1641, in full_dispatch_request
server_1 | rv = self.handle_user_exception(e)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_restful/init.py”, line 271, in error_router
server_1 | return original_handler(e)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1544, in handle_user_exception
server_1 | reraise(exc_type, exc_value, tb)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1639, in full_dispatch_request
server_1 | rv = self.dispatch_request()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1625, in dispatch_request
server_1 | return self.view_functionsrule.endpoint
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/utils.py”, line 226, in decorated_view
server_1 | elif not current_user.is_authenticated:
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 343, in getattr
server_1 | return getattr(self._get_current_object(), name)
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 302, in _get_current_object
server_1 | return self.__local()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/utils.py”, line 26, in
server_1 | current_user = LocalProxy(lambda: _get_user())
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/utils.py”, line 302, in _get_user
server_1 | current_app.login_manager._load_user()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/login_manager.py”, line 311, in _load_user
server_1 | return self._load_from_cookie(request.cookies[cookie_name])
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/login_manager.py”, line 350, in _load_from_cookie
server_1 | self.reload_user()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/login_manager.py”, line 279, in reload_user
server_1 | user = self.user_callback(user_id)
server_1 | File “/app/redash/authentication/init.py”, line 46, in load_user
server_1 | user = models.User.get_by_id_and_org(user_id, org)
server_1 | File “/app/redash/models.py”, line 250, in get_by_id_and_org
server_1 | return db.session.query(cls).filter(cls.id == object_id, cls.org == org).one()
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2884, in one
server_1 | ret = self.one_or_none()
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2854, in one_or_none
server_1 | ret = list(self)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2925, in iter
server_1 | return self._execute_and_instances(context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2948, in _execute_and_instances
server_1 | result = conn.execute(querycontext.statement, self._params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 948, in execute
server_1 | return meth(self, multiparams, params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py”, line 269, in _execute_on_connection
server_1 | return connection._execute_clauseelement(self, multiparams, params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1060, in _execute_clauseelement
server_1 | compiled_sql, distilled_params
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1200, in _execute_context
server_1 | context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1413, in _handle_dbapi_exception
server_1 | exc_info
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py”, line 203, in raise_from_cause
server_1 | reraise(type(exception), exception, tb=exc_tb, cause=cause)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1193, in _execute_context
server_1 | context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py”, line 507, in do_execute
server_1 | cursor.execute(statement, parameters)
server_1 | ProgrammingError: (psycopg2.ProgrammingError) column users.disabled_at does not exist
server_1 | LINE 1: …rs_password_hash, users.api_key AS users_api_key, users.disa…
server_1 | ^
server_1 | [SQL: ‘SELECT users.profile_image_url AS users_profile_image_url, users.groups AS users_groups, users.updated_at AS users_updated_at, users.created_at AS users_created_at, users.id AS users_id, users.org_id AS users_org_id, users.name AS users_name, users.email AS users_email, users.password_hash AS users_password_hash, users.api_key AS users_api_key, users.disabled_at AS users_disabled_at \nFROM users \nWHERE users.id = %(id_1)s AND %(param_1)s = users.org_id’] [parameters: {‘id_1’: u’1’, ‘param_1’: 1}] (Background on this error at: http://sqlalche.me/e/f405)
server_1 | [2019-03-12 22:06:25,885][PID:19][ERROR][redash] Exception on / [GET]
server_1 | Traceback (most recent call last):
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1988, in wsgi_app
server_1 | response = self.full_dispatch_request()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1641, in full_dispatch_request
server_1 | rv = self.handle_user_exception(e)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_restful/init.py”, line 271, in error_router
server_1 | return original_handler(e)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1544, in handle_user_exception
server_1 | reraise(exc_type, exc_value, tb)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1639, in full_dispatch_request
server_1 | rv = self.dispatch_request()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1625, in dispatch_request
server_1 | return self.view_functionsrule.endpoint
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/utils.py”, line 226, in decorated_view
server_1 | elif not current_user.is_authenticated:
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 343, in getattr
server_1 | return getattr(self._get_current_object(), name)
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 302, in _get_current_object
server_1 | return self.__local()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/utils.py”, line 26, in
server_1 | current_user = LocalProxy(lambda: _get_user())
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/utils.py”, line 302, in _get_user
server_1 | current_app.login_manager._load_user()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/login_manager.py”, line 311, in _load_user
server_1 | return self._load_from_cookie(request.cookies[cookie_name])
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/login_manager.py”, line 350, in _load_from_cookie
server_1 | self.reload_user()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/login_manager.py”, line 279, in reload_user
server_1 | user = self.user_callback(user_id)
server_1 | File “/app/redash/authentication/init.py”, line 46, in load_user
server_1 | user = models.User.get_by_id_and_org(user_id, org)
server_1 | File “/app/redash/models.py”, line 250, in get_by_id_and_org
server_1 | return db.session.query(cls).filter(cls.id == object_id, cls.org == org).one()
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2884, in one
server_1 | ret = self.one_or_none()
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2854, in one_or_none
server_1 | ret = list(self)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2925, in iter
server_1 | return self._execute_and_instances(context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2948, in _execute_and_instances
server_1 | result = conn.execute(querycontext.statement, self._params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 948, in execute
server_1 | return meth(self, multiparams, params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py”, line 269, in _execute_on_connection
server_1 | return connection._execute_clauseelement(self, multiparams, params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1060, in _execute_clauseelement
server_1 | compiled_sql, distilled_params
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1200, in _execute_context
server_1 | context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1413, in _handle_dbapi_exception
server_1 | exc_info
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py”, line 203, in raise_from_cause
server_1 | reraise(type(exception), exception, tb=exc_tb, cause=cause)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1193, in _execute_context
server_1 | context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py”, line 507, in do_execute
server_1 | cursor.execute(statement, parameters)
server_1 | ProgrammingError: (psycopg2.ProgrammingError) column users.disabled_at does not exist
server_1 | LINE 1: …rs_password_hash, users.api_key AS users_api_key, users.disa…


erver_1 | [2019-03-13 05:40:53,080] ERROR in app: Exception on /login [GET]
server_1 | Traceback (most recent call last):
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1988, in wsgi_app
server_1 | response = self.full_dispatch_request()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1641, in full_dispatch_request
server_1 | rv = self.handle_user_exception(e)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_restful/init.py”, line 271, in error_router
server_1 | return original_handler(e)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1544, in handle_user_exception
server_1 | reraise(exc_type, exc_value, tb)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1639, in full_dispatch_request
server_1 | rv = self.dispatch_request()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1625, in dispatch_request
server_1 | return self.view_functionsrule.endpoint
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_limiter/extension.py”, line 442, in __inner
server_1 | return obj(*a, **k)
server_1 | File “/app/redash/handlers/authentication.py”, line 104, in login
server_1 | if current_org == None and not settings.MULTI_ORG:
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 365, in
server_1 | eq = lambda x, o: x._get_current_object() == o
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 302, in _get_current_object
server_1 | return self.__local()
server_1 | File “/app/redash/authentication/org_resolving.py”, line 14, in _get_current_org
server_1 | g.org = Organization.get_by_slug(slug)
server_1 | File “/app/redash/models.py”, line 325, in get_by_slug
server_1 | return cls.query.filter(cls.slug == slug).first()
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2825, in first
server_1 | ret = list(self[0:1])
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2617, in getitem
server_1 | return list(res)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2925, in iter
server_1 | return self._execute_and_instances(context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2948, in _execute_and_instances
server_1 | result = conn.execute(querycontext.statement, self._params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 948, in execute
server_1 | return meth(self, multiparams, params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py”, line 269, in _execute_on_connection
server_1 | return connection._execute_clauseelement(self, multiparams, params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1060, in _execute_clauseelement
server_1 | compiled_sql, distilled_params
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1200, in _execute_context
server_1 | context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1413, in _handle_dbapi_exception
server_1 | exc_info
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py”, line 203, in raise_from_cause
server_1 | reraise(type(exception), exception, tb=exc_tb, cause=cause)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1193, in _execute_context
server_1 | context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py”, line 507, in do_execute
server_1 | cursor.execute(statement, parameters)
server_1 | OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly
server_1 | This probably means the server terminated abnormally
server_1 | before or while processing the request.
server_1 | [SQL: ‘SELECT organizations.updated_at AS organizations_updated_at, organizations.created_at AS organizations_created_at, organizations.id AS organizations_id, organizations.name AS organizations_name, organizations.slug AS organizations_slug, organizations.settings AS organizations_settings \nFROM organizations \nWHERE organizations.slug = %(slug_1)s \n LIMIT %(param_1)s’] [parameters: {‘slug_1’: ‘default’, ‘param_1’: 1}] (Background on this error at: http://sqlalche.me/e/e3q8)
server_1 | [2019-03-13 05:40:53,080][PID:13][ERROR][redash] Exception on /login [GET]
server_1 | Traceback (most recent call last):
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1988, in wsgi_app
server_1 | response = self.full_dispatch_request()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1641, in full_dispatch_request
server_1 | rv = self.handle_user_exception(e)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_restful/init.py”, line 271, in error_router
server_1 | return original_handler(e)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1544, in handle_user_exception
server_1 | reraise(exc_type, exc_value, tb)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1639, in full_dispatch_request
server_1 | rv = self.dispatch_request()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1625, in dispatch_request
server_1 | return self.view_functionsrule.endpoint
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_limiter/extension.py”, line 442, in __inner
server_1 | return obj(*a, **k)
server_1 | File “/app/redash/handlers/authentication.py”, line 104, in login
server_1 | if current_org == None and not settings.MULTI_ORG:
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 365, in
server_1 | eq = lambda x, o: x._get_current_object() == o
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 302, in _get_current_object
server_1 | return self.__local()
server_1 | File “/app/redash/authentication/org_resolving.py”, line 14, in _get_current_org
server_1 | g.org = Organization.get_by_slug(slug)
server_1 | File “/app/redash/models.py”, line 325, in get_by_slug
server_1 | return cls.query.filter(cls.slug == slug).first()
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2825, in first
server_1 | ret = list(self[0:1])
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2617, in getitem
server_1 | return list(res)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2925, in iter
server_1 | return self._execute_and_instances(context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2948, in _execute_and_instances
server_1 | result = conn.execute(querycontext.statement, self._params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 948, in execute
server_1 | return meth(self, multiparams, params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py”, line 269, in _execute_on_connection
server_1 | return connection._execute_clauseelement(self, multiparams, params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1060, in _execute_clauseelement
server_1 | compiled_sql, distilled_params
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1200, in _execute_context
server_1 | context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1413, in _handle_dbapi_exception
server_1 | exc_info
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py”, line 203, in raise_from_cause
server_1 | reraise(type(exception), exception, tb=exc_tb, cause=cause)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1193, in _execute_context
server_1 | context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py”, line 507, in do_execute
server_1 | cursor.execute(statement, parameters)
server_1 | OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly
server_1 | This probably means the server terminated abnormally
server_1 | before or while processing the request.
server_1 | [SQL: ‘SELECT organizations.updated_at AS organizations_updated_at, organizations.created_at AS organizations_created_at, organizations.id AS organizations_id, organizations.name AS organizations_name, organizations.slug AS organizations_slug, organizations.settings AS organizations_settings \nFROM organizations \nWHERE organizations.slug = %(slug_1)s \n LIMIT %(param_1)s’] [parameters: {‘slug_1’: ‘default’, ‘param_1’: 1}] (Background on this error at: http://sqlalche.me/e/e3q8)
server_1 | [2019-03-13 05:40:53,092][PID:13][INFO][metrics] method=GET path=/login endpoint=redash_login status=500 content_type=? content_length=-1 duration=17.29 query_count=0 query_duration=0.00
server_1 | [2019-03-13 05:40:53,666] ERROR in app: Exception on /favicon.ico [GET]
server_1 | Traceback (most recent call last):
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1988, in wsgi_app
server_1 | response = self.full_dispatch_request()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1641, in full_dispatch_request
server_1 | rv = self.handle_user_exception(e)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_restful/init.py”, line 271, in error_router
server_1 | return original_handler(e)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1544, in handle_user_exception
server_1 | reraise(exc_type, exc_value, tb)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1639, in full_dispatch_request
server_1 | rv = self.dispatch_request()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1625, in dispatch_request
server_1 | return self.view_functionsrule.endpoint
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/utils.py”, line 226, in decorated_view
server_1 | elif not current_user.is_authenticated:
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 343, in getattr
server_1 | return getattr(self._get_current_object(), name)
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 302, in _get_current_object
server_1 | return self.__local()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/utils.py”, line 26, in
server_1 | current_user = LocalProxy(lambda: _get_user())
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/utils.py”, line 302, in _get_user
server_1 | current_app.login_manager._load_user()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/login_manager.py”, line 317, in _load_user
server_1 | return self.reload_user()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/login_manager.py”, line 279, in reload_user
server_1 | user = self.user_callback(user_id)
server_1 | File “/app/redash/authentication/init.py”, line 44, in load_user
server_1 | org = current_org._get_current_object()
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 302, in _get_current_object
server_1 | return self.__local()
server_1 | File “/app/redash/authentication/org_resolving.py”, line 14, in _get_current_org
server_1 | g.org = Organization.get_by_slug(slug)
server_1 | File “/app/redash/models.py”, line 325, in get_by_slug
server_1 | return cls.query.filter(cls.slug == slug).first()
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2825, in first
server_1 | ret = list(self[0:1])
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2617, in getitem
server_1 | return list(res)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2925, in iter
server_1 | return self._execute_and_instances(context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2948, in _execute_and_instances
server_1 | result = conn.execute(querycontext.statement, self._params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 948, in execute
server_1 | return meth(self, multiparams, params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py”, line 269, in _execute_on_connection
server_1 | return connection._execute_clauseelement(self, multiparams, params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1060, in _execute_clauseelement
server_1 | compiled_sql, distilled_params
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1200, in _execute_context
server_1 | context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1413, in _handle_dbapi_exception
server_1 | exc_info
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py”, line 203, in raise_from_cause
server_1 | reraise(type(exception), exception, tb=exc_tb, cause=cause)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1193, in _execute_context
server_1 | context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py”, line 507, in do_execute
server_1 | cursor.execute(statement, parameters)
server_1 | OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly
server_1 | This probably means the server terminated abnormally
server_1 | before or while processing the request.
server_1 | [SQL: ‘SELECT organizations.updated_at AS organizations_updated_at, organizations.created_at AS organizations_created_at, organizations.id AS organizations_id, organizations.name AS organizations_name, organizations.slug AS organizations_slug, organizations.settings AS organizations_settings \nFROM organizations \nWHERE organizations.slug = %(slug_1)s \n LIMIT %(param_1)s’] [parameters: {‘slug_1’: ‘default’, ‘param_1’: 1}] (Background on this error at: http://sqlalche.me/e/e3q8)
server_1 | [2019-03-13 05:40:53,666][PID:19][ERROR][redash] Exception on /favicon.ico [GET]
server_1 | Traceback (most recent call last):
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1988, in wsgi_app
server_1 | response = self.full_dispatch_request()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1641, in full_dispatch_request
server_1 | rv = self.handle_user_exception(e)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_restful/init.py”, line 271, in error_router
server_1 | return original_handler(e)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1544, in handle_user_exception
server_1 | reraise(exc_type, exc_value, tb)
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1639, in full_dispatch_request
server_1 | rv = self.dispatch_request()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask/app.py”, line 1625, in dispatch_request
server_1 | return self.view_functionsrule.endpoint
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/utils.py”, line 226, in decorated_view
server_1 | elif not current_user.is_authenticated:
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 343, in getattr
server_1 | return getattr(self._get_current_object(), name)
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 302, in _get_current_object
server_1 | return self.__local()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/utils.py”, line 26, in
server_1 | current_user = LocalProxy(lambda: _get_user())
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/utils.py”, line 302, in _get_user
server_1 | current_app.login_manager._load_user()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/login_manager.py”, line 317, in _load_user
server_1 | return self.reload_user()
server_1 | File “/usr/local/lib/python2.7/dist-packages/flask_login/login_manager.py”, line 279, in reload_user
server_1 | user = self.user_callback(user_id)
server_1 | File “/app/redash/authentication/init.py”, line 44, in load_user
server_1 | org = current_org._get_current_object()
server_1 | File “/usr/local/lib/python2.7/dist-packages/werkzeug/local.py”, line 302, in _get_current_object
server_1 | return self.__local()
server_1 | File “/app/redash/authentication/org_resolving.py”, line 14, in _get_current_org
server_1 | g.org = Organization.get_by_slug(slug)
server_1 | File “/app/redash/models.py”, line 325, in get_by_slug
server_1 | return cls.query.filter(cls.slug == slug).first()
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2825, in first
server_1 | ret = list(self[0:1])
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2617, in getitem
server_1 | return list(res)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2925, in iter
server_1 | return self._execute_and_instances(context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py”, line 2948, in _execute_and_instances
server_1 | result = conn.execute(querycontext.statement, self._params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 948, in execute
server_1 | return meth(self, multiparams, params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py”, line 269, in _execute_on_connection
server_1 | return connection._execute_clauseelement(self, multiparams, params)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1060, in _execute_clauseelement
server_1 | compiled_sql, distilled_params
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1200, in _execute_context
server_1 | context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1413, in _handle_dbapi_exception
server_1 | exc_info
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py”, line 203, in raise_from_cause
server_1 | reraise(type(exception), exception, tb=exc_tb, cause=cause)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py”, line 1193, in _execute_context
server_1 | context)
server_1 | File “/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py”, line 507, in do_execute
server_1 | cursor.execute(statement, parameters)
server_1 | OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly
server_1 | This probably means the server terminated abnormally

postgres_1 | ERROR: column queries.tags does not exist at character 840
postgres_1 | STATEMENT: SELECT queries.query AS queries_query, queries.updated_at AS queries_updated_at, queries.created_at AS queries_created_at, queries.id AS queries_id, queries.version AS queries_version, queries.org_id AS queries_org_id, queries.data_source_id AS queries_data_source_id, queries.latest_query_data_id AS queries_latest_query_data_id, queries.name AS queries_name, queries.description AS queries_description, queries.query_hash AS queries_query_hash, queries.api_key AS queries_api_key, queries.user_id AS queries_user_id, queries.last_modified_by_id AS queries_last_modified_by_id, queries.is_archived AS queries_is_archived, queries.is_draft AS queries_is_draft, queries.schedule AS queries_schedule, queries.schedule_failures AS queries_schedule_failures, queries.options AS queries_options, queries.search_vector AS queries_search_vector, queries.tags AS queries_tags, query_results_1.id AS query_results_1_id, query_results_1.retrieved_at AS query_results_1_retrieved_at
postgres_1 | FROM queries LEFT OUTER JOIN query_results AS query_results_1 ON query_results_1.id = queries.latest_query_data_id
postgres_1 | WHERE queries.schedule IS NOT NULL ORDER BY queries.id
postgres_1 | ERROR: column users.disabled_at does not exist at character 348
postgres_1 | STATEMENT: SELECT users.profile_image_url AS users_profile_image_url, users.groups AS users_groups, users.updated_at AS users_updated_at, users.created_at AS users_created_at, users.id AS users_id, users.org_id AS users_org_id, users.name AS users_name, users.email AS users_email, users.password_hash AS users_password_hash, users.api_key AS users_api_key, users.disabled_at AS users_disabled_at
postgres_1 | FROM users
postgres_1 | WHERE users.id = ‘1’ AND 1 = users.org_id
postgres_1 | ERROR: column users.disabled_at does not exist at character 348
postgres_1 | STATEMENT: SELECT users.profile_image_url AS users_profile_image_url, users.groups AS users_groups, users.updated_at AS users_updated_at, users.created_at AS users_created_at, users.id AS users_id, users.org_id AS users_org_id, users.name AS users_name, users.email AS users_email, users.password_hash AS users_password_hash, users.api_key AS users_api_key, users.disabled_at AS users_disabled_at
postgres_1 | FROM users
postgres_1 | WHERE users.id = ‘1’ AND 1 = users.org_id
postgres_1 | ERROR: column queries.tags does not exist at character 840
postgres_1 | STATEMENT: SELECT queries.query AS queries_query, queries.updated_at AS queries_updated_at, queries.created_at AS queries_created_at, queries.id AS queries_id, queries.version AS queries_version, queries.org_id AS queries_org_id, queries.data_source_id AS queries_data_source_id, queries.latest_query_data_id AS queries_latest_query_data_id, queries.name AS queries_name, queries.description AS queries_description, queries.query_hash AS queries_query_hash, queries.api_key AS queries_api_key, queries.user_id AS queries_user_id, queries.last_modified_by_id AS queries_last_modified_by_id, queries.is_archived AS queries_is_archived, queries.is_draft AS queries_is_draft, queries.schedule AS queries_schedule, queries.schedule_failures AS queries_schedule_failures, queries.options AS queries_options, queries.search_vector AS queries_search_vector, queries.tags AS queries_tags, query_results_1.id AS query_results_1_id, query_results_1.retrieved_at AS query_results_1_retrieved_at
postgres_1 | FROM queries LEFT OUTER JOIN query_results AS query_results_1 ON query_results_1.id = queries.latest_query_data_id
postgres_1 | WHERE queries.schedule IS NOT NULL ORDER BY queries.id
postgres_1 | ERROR: column queries.tags does not exist at character 840
postgres_1 | STATEMENT: SELECT queries.query AS queries_query, queries.updated_at AS queries_updated_at, queries.created_at AS queries_created_at, queries.id AS queries_id, queries.version AS queries_version, queries.org_id AS queries_org_id, queries.data_source_id AS queries_data_source_id, queries.latest_query_data_id AS queries_latest_query_data_id, queries.name AS queries_name, queries.description AS queries_description, queries.query_hash AS queries_query_hash, queries.api_key AS queries_api_key, queries.user_id AS queries_user_id, queries.last_modified_by_id AS queries_last_modified_by_id, queries.is_archived AS queries_is_archived, queries.is_draft AS queries_is_draft, queries.schedule AS queries_schedule, queries.schedule_failures AS queries_schedule_failures, queries.options AS queries_options, queries.search_vector AS queries_search_vector, queries.tags AS queries_tags, query_results_1.id AS query_results_1_id, query_results_1.retrieved_at AS query_results_1_retrieved_at
postgres_1 | FROM queries LEFT OUTER JOIN query_results AS query_results_1 ON query_results_1.id = queries.latest_query_data_id
postgres_1 | WHERE queries.schedule IS NOT NULL ORDER BY queries.id
postgres_1 | ERROR: column queries.tags does not exist at character 840
postgres_1 | STATEMENT: SELECT queries.query AS queries_query, queries.updated_at AS queries_updated_at, queries.created_at AS queries_created_at, queries.id AS queries_id, queries.version AS queries_version, queries.org_id AS queries_org_id, queries.data_source_id AS queries_data_source_id, queries.latest_query_data_id AS queries_latest_query_data_id, queries.name AS queries_name, queries.description AS queries_description, queries.query_hash AS queries_query_hash, queries.api_key AS queries_api_key, queries.user_id AS queries_user_id, queries.last_modified_by_id AS queries_last_modified_by_id, queries.is_archived AS queries_is_archived, queries.is_draft AS queries_is_draft, queries.schedule AS queries_schedule, queries.schedule_failures AS queries_schedule_failures, queries.options AS queries_options, queries.search_vector AS queries_search_vector, queries.tags AS queries_tags, query_results_1.id AS query_results_1_id, query_results_1.retrieved_at AS query_results_1_retrieved_at
postgres_1 | FROM queries LEFT OUTER JOIN query_results AS query_results_1 ON query_results_1.id = queries.latest_query_data_id
postgres_1 | WHERE queries.schedule IS NOT NULL ORDER BY queries.id
postgres_1 | ERROR: column queries.tags does not exist at character 840

Ahhh, that’s interesting. It looks like the SQL commands in the backup aren’t using CASCADE properly, and that’s causing problems. Looks like an alternative approach to backing up is probably needed. :smile:

An important thing I noticed after writing down the steps I first used… is that the PostgreSQL database is actually created in a standard directory (for me, it’s /opt/redash/postgres-data), outside of the Docker containers. When the Docker PostgreSQL container starts, it mounts that directory into itself and reads/writes data there.

So, a much easier approach to backup the database is to shut down the Docker containers, then copy that /opt/redash/postgres-data directory somewhere safe. That’ll be your backup. :slight_smile:

To copy the old Redash4 database across to your newer Redash 6 installation, I’d do this:

  1. Make a backup of your Redash4 database for safety (eg in case something goes wrong)
    • On the Redash 4 server: rsync -aP /opt/redash/postgres-data /somewhere/safe
  2. Make a backup of your Redash6 database for safety (again, in case something goes wrong)
    • On the Redash 6 server: rsync -aP /opt/redash/postgres-data /somewhere/else/safe
  3. Delete the Redash6 database directory (/opt/redash/postgres-data)
    • On the Redash 6 server: rm -rf /opt/redash/postgres-data
  4. Copy the Redash 4 database to the Redash 6 server
    • The command really depends where you’ve put stuff. :slight_smile:
  5. Upgrade the Redash 4 database to Redash 6
    • On the Redash 6 server: docker-compose run --rm server manage db upgrade
    • (that’s copied from the How to Upgrade page.

That’s the concept I’m thinking of anyway. Make sure you backup everything first, (etc) and have read the How to Upgrade page before you try it.

Does it make sense so far? :smile:

Hi, did you figure it out back&restore via the sql file method?

Can anyone please provide a documentation for connecting postgres via VM? I couldn’t seem to find any docs. Thank you

1 Like

I needed to move my hosted redash server from one cloud platform to another, and since they were different platforms, snapshots didn’t work. I followed @justinclift directions, and it worked for me. Here are my steps:

  1. start a fresh instance of redash on a new server. (I used the official AMI from redash)
  2. shutdown all the docker containers on this server.
  3. shutdown all the docker containers on the old redash server, and zip up /opt/redash. I zip up /opt/redash and not just /opt/redash/postgres-data because I want to copy all my settings in the /opt/redash/env file to the new server as well, as it contains many important configuration such as the REDASH_SECRET_KEY
  4. copy over the zip file and replace /opt/redash with its content
  5. start redash containers with: docker-compose up -d

I find this method much better than dumping the postgres database, which didn’t work well for me. This upgrades my fresh instance to the redash version I was running, since the zip file included the docker-compose.yml from my old server, and the AMI version was running an older version.

3 Likes