From 134533e34215641fad3bc40dc8ec6b4a5b7c8877 Mon Sep 17 00:00:00 2001 From: profitroll Date: Sun, 4 May 2025 00:48:19 +0200 Subject: [PATCH] Added instructions for upgrading from release and source --- README.md | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 19a4c6a..46f9085 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ Open source Discord bot for quizzes and quest-like events. ### Installation from release 1. Download the release archive from [Releases](https://git.end-play.xyz/profitroll/QuizBot/releases) -2. Unpack the archive to a folder of your choice -3. Go to the project folder +2. Unpack the archive to a directory of your choice +3. Go to the project's directory 4. Create a virtual environment: `python3 -m venv .venv` -5. Activate virtual environment: +5. Activate the virtual environment: - Linux: `source .venv/bin/activate` - Windows (cmd): `.venv/bin/activate.bat` - Windows (PowerShell): `.venv/bin/activate.ps1` @@ -26,11 +26,13 @@ Open source Discord bot for quizzes and quest-like events. 7. Copy example config to a real file: `cp config_example.json config.json` 8. Configure the bot (see [Configuration](#configuration)) 9. Start the bot: `python main.py` +10. The bot can be stopped by a keyboard interrupt (`Ctrl+C`) and a virtual environment can be deactivated using + `deactivate` ### Installation from source 1. Clone the repository: `git clone https://git.end-play.xyz/profitroll/QuizBot.git` -2. Go to the project's folder: `cd QuizBot` +2. Go to the project's directory: `cd QuizBot` 3. Continue from step 4 of [Installation from release](#installation-from-release) ## Configuration @@ -39,7 +41,29 @@ TODO ## Upgrading -TODO +### Upgrading from release + +Installing over the older version is not supported. Fresh installation is necessary to prevent data corruption. + +1. Make a backup of the project's directory. Some of the old files will be reused +2. Follow the [Installation from release](#installation-from-release) from the beginning and stop before 7th step +3. Copy file `config.json` and directory `data` from the backup you made into the new installation's directory +4. While still in the virtual environment, migrate the database: `python main.py --migrate` + +After these steps are performed, the bot is ready to be started and used. + +### Upgrading from source + +1. Make a backup of the project's directory +2. Go to the project's directory +3. Update the project: `git pull` +4. Activate the virtual environment: + - Linux: `source .venv/bin/activate` + - Windows (cmd): `.venv/bin/activate.bat` + - Windows (PowerShell): `.venv/bin/activate.ps1` +5. Migrate the database: `python main.py --migrate` + +After these steps are performed, the bot is ready to be started and used. ## Usage @@ -51,4 +75,4 @@ TODO Only admins should have access to following commands: `/config`, `/event`, `/stage` and `/user`. Allowing access to `/status` is not recommended, however won't do any harm if done so. 3. Configure bot for usage on your server using `/config set` providing all the necessary arguments. - Timezones are compatible with summer time (e.g. `CET` will be interpreted as `CEST` during summer time). \ No newline at end of file + Timezones are compatible with daylight saving time (e.g. `CET` will be interpreted as `CEST` during daylight saving). \ No newline at end of file