Note: This guide assumes that the default database name (redash) has not been changed.
select t1.datname AS db_name, pg_size_pretty(pg_database_size(t1.datname)) as db_size from pg_database t1 where t1.datname = 'redash'
sudo -u redash pg_dump redash | gzip > redash_backup.gz
sudo -u postgres -i
dropdb redash createdb -T template0 redash gunzip -c redash_backup.gz | psql redash
psql -c "ALTER ROLE redash_reader WITH PASSWORD 'yourpasswordgoeshere';"
Note: Then you must navigate to the ‘Redash metadata’ data source (/data_sources/1) in the new Redash installation and change the password to match the one entered above.
psql -c "grant select(id,name,type) ON data_sources to redash_reader;" redash psql -c "grant select(id,name) ON users to redash_reader;" redash psql -c "grant select on events, queries, dashboards, widgets, visualizations, query_results to redash_reader;" redash
Create a new query in redash (using Redash metadata as the data source) to test that everything is working as expected.