Migrating production Bitnami Redash to a new instance + Upgrade to V8

I’m using a legacy Redash V5 (Bitnami) and need to migrate it to a new instance with version 8 installed. The reason is providing the ability to connect to Presto using password! Based on my research, the only way to migrate dashboards and queries is to make a backup from Postgres and import it to the new instance. Unfortunately, I stuck in importing my backup and need help. Below are my performed steps:

  1. make a tar.gz backup using the postgres dump from the running instance. (Backup size is 3.8 GB) Using: pg_dump -U postgres -F c bitnami_redash > /newvolume/backup.tar.gz
  2. Installed a docker based Redash with the exact same version.
  3. Copy the backup file to my ubuntu server.
  4. Import the backup file using: cat backup.tar.gz | docker exec -i redash_postgres_1 pg_restore -Upostgres

As I said, the import process is taking so long without any proper result. I really appreciate any help to solve my problem or any other practical way to do the needful. Thanks!

Is there any other cleaner way to do the migration?!!

I haven’t upgraded before. But looking through the legacy upgrade guide it mentions Bitnami instances are not compatible with the upgrade script. How long has the database import been running? Are you certain it’s not working?

If the upgrade script won’t work, you can manually apply the migrations like @arikfr suggested in this thread and then migrate your data sources, queries, visualizations, users, and groups via the API.

This recent post on the forum relates to migrating from one instance to another. It may also be useful to you.

Thanks for your reply. Actually, upgrade isn’t my problem as I already installed the new version of Redash. My biggest problem is moving queries and dashboards from the current Bitnami Redash to the new server. Unfortunately, I cannot perform the upgrade on Bitnami instance and moving the data to the new one.

1 Like

This could help too. Basically you split the upgrade and the migration into two steps. And here’s further feedback from another user who successfully accomplished the upgrade.

1 Like

Well, finally I managed to do the upgrade. As you may know, Bitnami Redash is a little bit different and also the upgrade is quite complicated. Unfortunately, the provided upgrade instructions by Bitnami, is old and not doable for the current versions. Luckily and after contacting their support, they provided me an instruction for upgrade and using that, I successfully upgraded my Bitnami Redash from v5 to v7 first and then v8. I share the instruction here, hopefully can save some time for someone who has intend to do the same!

First, create a backup of your current version:

mv /opt/bitnami/apps/redash/htdocs /opt/bitnami/apps/redash/htdocs.bak


Create the htdocs directory for the new version and unpack it there:

cd /opt/bitnami/apps/redash
wget https://github.com/getredash/redash/archive/v7.0.0.tar.gz
mkdir /opt/bitnami/apps/redash/htdocs
tar -C /opt/bitnami/apps/redash/htdocs -xvf v7.0.0.tar.gz --strip-components 1

Copy your .env file and your venv/ directory from the current version to the new version:

cp /opt/bitnami/apps/redash/htdocs.bak/.env /opt/bitnami/apps/redash/htdocs
cp -R /opt/bitnami/apps/redash/htdocs.bak/venv /opt/bitnami/apps/redash/htdocs


Edit your  */opt/bitnami/apps/redash/htdocs/.env*  file and delete the  `REDASH_STATIC_ASSETS_PATH`  line.

Change permissions of the htdocs folder:

sudo chown -R bitnami:redash /opt/bitnami/apps/redash/htdocs
sudo find /opt/bitnami/apps/redash/htdocs -type d -exec chmod 775 {} \;

Install new requirements (First you need to load the bitnami environment and change to bitnami user)

sudo /opt/bitnami/use_redash
su bitnami
cd /opt/bitnami/apps/redash/htdocs
. venv/bin/activate
pip install -r requirements.txt


Create a home folder for the  `redash`  user

sudo mkdir /home/redash
sudo chown redash:redash /home/redash/

Migrate the database:

bin/run ./manage.py db upgrade


Generate new static files. (Install git and nodejs is required)

sudo apt-get install -y git
sudo curl -o '/opt/node-v10.16.3-linux-x64.tar.xz' 'https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz'
sudo tar xf /opt/node-v10.16.3-linux-x64.tar.xz -C /opt/
export PATH=/opt/node-v10.16.3-linux-x64/bin:$PATH
cd /opt/bitnami/apps/redash/htdocs
npm install && npm run build

Finally, restart the servers:

sudo /opt/bitnami/ctlscript.sh restart

1 Like

I strongly recommend everyone NOT to use Bitnami’s images, but to use our official images, as detailed on: https://redash.io/help/open-source/setup.

All of our documentation assumes a specific setup, which Bitnami’s images don’t follow. This means that anytime you need assistance it’s almost impossible for us to help and all the admin guides are not relevant.

2 Likes

That’s absolutely right! I’m trying to get rid of it as well! But so far, couldn’t manage to move our data!

1 Like

The next step is to migrate from your Bitnami instance to Docker, yes?

1 Like

Yes! My only problem is the query_results table is so huge and I cannot export it. I couldn’t do the migration using the dump method and I think it because of Bitnami database differences. What I’m trying at the moment is to export the tables one by one and import to Docker version database. I managed to import the users, datasources and dashboards, but for queries I need to import the query_results first. query_results table is so huge and I have some difficulties to export it. It would be great if you guys can provide me a hint!

The query_results table is just a cache. Move all tables except that one. Your Docker Redash will refill the the cache the first time it executes your queries.

1 Like

If I don’t import the query_results table first, I’ll face this error while importing queries:

It seems that some dependencies are there!

That’s a database constraint. I’d blow away the last_query_result_id values (set them NULL) and try again. Of course keep a copy in case it doesn’t work.

1 Like

You mean set them NULL in the source database or in the destination?

In the destination. Your problem is the database won’t allow the queries table to point at a non-existent result. You probably need to duplicate the queries table in your source db, set the result_id NULL and then try to move it.

1 Like

Is there a way to upgrade self-hosted redash v7 to v8?

The command: sudo bin/upgrade --channel beta gives only the possibility to “downgrade” to v6, because the channel release API (https://version.redash.io/api/releases?channel=beta) returns only v6.

1 Like

Which installation type you’re using? Docker or Legacy? By the way, there is an upgrade instruction here for both types.

1 Like

I am using the lagacy version, but as I described in my previous post, the normal “upgrade” instruction will not upgrade to v8.