Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --overwrite option to setup.sh #60

Merged
merged 4 commits into from
Apr 2, 2024
Merged

Conversation

justinclift
Copy link
Member

@justinclift justinclift commented Apr 1, 2024

Up until now the setup.sh script automatically deletes any existing environment file in /opt/redash/env, which has caught out numerous people and is a source of issues.

From now onwards, an existing environment file will be kept, with only missing mandatory fields added to it to help ensure a working configuration.

This commit also introduces a new (optional) --overwrite parameter to setup.sh, which tells it to completely overwrite any existing environment file and its matching database.

# sh setup.sh     <-- standard installation procedure for Redash
# sh setup.sh --overwrite   <-- deletes and recreates the existing env file and database

DO NOT use the new --overwrite option if you want to keep your existing database, as it WILL cause your database to be replaced with an empty new one.

Up until now the setup.sh script automatically deletes any existing
environment file in /opt/redash/env, which has caught out numerous
people and is a source of issues.

From now onwards, an existing environment file will be kept, with
only missing mandatory fields added to it to help ensure a working
configuration.

This commit also introduces a new --overwrite parameter to setup.sh,
which tells it to completely overwrite any existing environment file
and its matching database.

DO NOT use the new --overwrite option if you want to keep your
existing database, is it WILL cause your database to be replaced
with an empty new one.
@justinclift
Copy link
Member Author

justinclift commented Apr 1, 2024

@getredash/maintainers @nexovec I'll probably merge this tomorrow if I don't hear from anyone. 😄


Btw, please don't anyone merge this just yet. It's working in my initial testing on Debian 12.5, but I haven't tested the other distro's yet. Will do that over the next few hours, and may need to make some updates depending on what turns up. 😄 All tested and working fine. 😄

@justinclift
Copy link
Member Author

justinclift commented Apr 1, 2024

Hmmm, might be a decent idea to run docker compose down (with appropriate path to the redash compose file) to automatically shut down any running Redash instance when --overwrite is passed.

Will have a look at that later on today. 😄 Added.

@justinclift
Copy link
Member Author

justinclift commented Apr 1, 2024

Tested on:

  • Alma Linux 8.x & 9.x
  • CentOS Stream 9.x
  • Debian 12.x
  • Oracle Linux 9.x
  • Red Hat Enterprise Linux 8.x & 9.x
  • Rocky Linux 8.x & 9.x
  • Ubuntu LTS 20.04 & 22.04

@justinclift
Copy link
Member Author

Ahhhh, the README file needs to mention the --overwrite option too.

@justinclift
Copy link
Member Author

Going to merge this now. I've finished (manually) testing the updated script on all of the supported Linux distributions, and updated the README to include the new option.

@justinclift justinclift merged commit 0bf40b9 into master Apr 2, 2024
1 check passed
@justinclift justinclift deleted the env_replace_option_v1 branch April 2, 2024 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant