Lost Secret Key..now what

Due to my accident, I deleted EC2 of running redash (AMI, probably version 8), so I had to reupload redash again. But unfortunately, I do not know any old redash_cookie_secret and redash_secret_key. Since I had backend RDS (Postgresql) for previous EC2, I was able to just relocate to new EC2 and get queries, dashboards and users info. However, since I do not have old redash_cookie_secret and redash_secret_key, invalid token error is happening in data sources and new queries. Is there a way to restore old redash_cookie_secret and redash_secret_key from RDS, by chance? If not, is there a way to keep my old dashboards/queries but just replace data sources to new one? Thank you.

Welcome to the forum! Sorry you’ve experienced data loss.



UPDATE queries SET data_source_id = <new id> WHERE data_source_id = <old_id>

To prevent this in the future you can KMS to hold your secret keys.

1 Like

After some experimentation I determined that the fix here is a bit complicated, but doable. I wrote about it in detail here:

Note: You will need to adapt these commands to your environment. For example, you won’t connect to a postgres container with docker-compose, you’ll connect to your RDS postgres instead. The linked instructions are otherwise accurate.

1 Like