Postgres9.5.6 migration (from Redash_v7 to v8)

Issue Summary

  • I dumped data of postgres9.5.6 (redash v7) using ‘pg_dump’ command.
  • I imported the data to postgres9.6.23 (redash v8).
  • It started redash v8 and I could login with adimn account.
  • But “Datasource” does not work correctly.

Technical details:

  • Now, we use Redash 7.0.0.b18042 (docker).
  • I want to migrate to v8.
  • I dumped postgres-data of v7. (command : ‘pg_dump -U postgres postgres | gzip > pgdata.gz’ )
  • I built brand new Redash v8 using setup.sh. (8.0.0.b32245)
  • And I stopped it. (cd /opt/redash ; docker-compose down)
  • I started temp container.
# docker container run -d -v /opt/redash/postgres-data:/var/lib/postgresql/data -p 5432:5432 postgres:9.6-alpine
(I dropped template1, and create template1)
  • I imported data to new postgres (command: ‘zcat pgdata.gz | psql -U postgres -d postgres’)

  • I removed temp container.(stop & rm)

  • I started redash v8.

# cd /opt/redash
# docker-compose run --rm server manage db upgrade
# docker-compose run --rm server create_db
# docker-compose up -d --remove-orphans
  • It looks pretty good, but only the data source isn’t working.

  • any workaround?

I commented out “REDASH_SECRET_KEY” in env file.

PYTHONUNBUFFERED=0
REDASH_LOG_LEVEL=INFO
REDASH_REDIS_URL=redis://redis:6379/0
POSTGRES_PASSWORD=*****bna
REDASH_COOKIE_SECRET: *****uru
# REDASH_SECRET_KEY=*****mvw
REDASH_DATABASE_URL=postgresql://postgres:*****bna@postgres/postgres

and restart redash, then I could access datasources.

…But, is this ok to use redash v8 in the commented out state ??

I commented out “REDASH_SECRET_KEY” in env file.

We’ve actually got a PR open right now adding documentation about this (PR here).

The secret key is used to encrypt your data source details. if you don’t set it, the cookie secret is used instead.

1 Like

In order for Redash to view and use the data sources from your previous instance, it must have the same secret key available that was used to encrypt that data on the previous instance.

1 Like