Skip to content

Commit

Permalink
Merge pull request #3507 from mathesar-foundation/upgrade-docs
Browse files Browse the repository at this point in the history
Adds upgrade documentation for 0.1.6, fixes existing issues with upgrade docs
  • Loading branch information
seancolsen authored Mar 27, 2024
2 parents dfaea91 + 614233c commit 927d2de
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 13 deletions.
3 changes: 2 additions & 1 deletion docs/docs/administration/upgrade/0.1.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ If you installed Mathesar [from scratch](../../installation/build-from-source/in
!!! note
Your installation directory may be different from above if you used a different directory when installing Mathesar.

1. Pull the latest version from the repository
1. Pull version 0.1.4 from the repository

```
git pull https://github.com/mathesar-foundation/mathesar.git
git checkout 0.1.4
```

1. Update Python dependencies
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/administration/upgrade/0.1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ docker compose -f /etc/mathesar/docker-compose.yml up --pull always -d

### For installations done from scratch

If you installed from scratch, the upgrade instructions are the same as [for 0.1.4](../upgrade/0.1.4.md#scratch), but you can skip Step 5 – you do not need to change the environment variables.
If you installed from scratch, the upgrade instructions are the same as [for 0.1.4](./0.1.4.md#scratch), except that you'll need to specify version 0.1.5 when pulling code from the repository in Step 2. You should also skip Step 5 – you do not need to change the environment variables.
86 changes: 86 additions & 0 deletions docs/docs/administration/upgrade/0.1.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Upgrade Mathesar to 0.1.6

### For installations using Docker Compose

If you have a Docker compose installation (including one from the guided script), run the command below:

```
docker compose -f /etc/mathesar/docker-compose.yml up --pull always -d
```

!!! warning "Your installation directory may be different"
You may need to change `/etc/mathesar/` in the command above if you chose to install Mathesar to a different directory.


### For installations done from scratch

If you installed Mathesar [from scratch](../../installation/build-from-source/index.md), then use these steps to upgrade your installation to 0.1.6.

1. Go to your Mathesar installation directory

```
cd xMATHESAR_INSTALLATION_DIRx
```

!!! note
Your installation directory may be different from above if you used a different directory when installing Mathesar.

1. Pull version 0.1.6 from the repository

```
git pull https://github.com/mathesar-foundation/mathesar.git
git checkout 0.1.6
```

1. Update Python dependencies

```
pip install -r requirements-prod.txt
```

1. Activate our virtual environment

```
source ./mathesar-venv/bin/activate
```

1. You can skip the following if you're upgrading from versions 0.1.4 and above.
- If you're upgrading from versions <= 0.1.3, update your environment variables according to the [the new configuration specification](../../configuration/env-variables.md#db).
- In particular, you must put the connection info for the internal DB into new `POSTGRES_*` variables. The `DJANGO_DATABASE_URL` variable is no longer supported.

1. Add the environment variables to the shell before running Django commands

```
export $(sudo cat .env)
```

1. Run Django migrations

```
python manage.py migrate
```

1. Download and extract frontend assets

```
wget https://github.com/mathesar-foundation/mathesar/releases/download/0.1.6/static_files.zip
unzip static_files.zip && mv static_files mathesar/static/mathesar && rm static_files.zip
```

1. Compile Mathesar translation files

```
python manage.py compilemessages
```

1. Update Mathesar functions on the database:

```
python -m mathesar.install --skip-confirm | tee /tmp/install.py.log
```

1. Restart the gunicorn server

```
systemctl restart gunicorn
```
13 changes: 2 additions & 11 deletions docs/docs/installation/build-from-source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ Then press <kbd>Enter</kbd> to customize this guide with your domain name.
CREATE DATABASE mathesar_django OWNER mathesar;
```

1. Now we let us create a database for storing your data.

```postgresql
CREATE DATABASE your_db_name OWNER mathesar;
```

1. Press <kbd>Ctrl</kbd>+<kbd>D</kbd> to exit the `psql` shell.


Expand Down Expand Up @@ -132,7 +126,7 @@ Then press <kbd>Enter</kbd> to customize this guide with your domain name.
1. Clone the git repo into the installation directory.

```
git clone https://github.com/centerofci/mathesar.git .
git clone https://github.com/mathesar-foundation/mathesar.git .
```

1. Checkout the tag of the latest stable release, `{{mathesar_version}}`.
Expand All @@ -144,9 +138,6 @@ Then press <kbd>Enter</kbd> to customize this guide with your domain name.
!!! warning "Important"
If you don't run the above command you'll end up installing the latest _development_ version of Mathesar, which will be less stable.

!!! tip
You can install a specific Mathesar release by running commands like `git checkout 0.1.1` (to install version 0.1.1, for example). You can see all available versions by running `git tag`.

1. We need to create a python virtual environment for the Mathesar application.

```
Expand Down Expand Up @@ -219,7 +210,7 @@ Then press <kbd>Enter</kbd> to customize this guide with your domain name.

```
wget https://github.com/mathesar-foundation/mathesar/releases/download/{{mathesar_version}}/static_files.zip
unzip static_files.zip && mv static_files mathesar/static/mathesar
unzip static_files.zip && mv static_files mathesar/static/mathesar && rm static_files.zip
```


Expand Down
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ nav:
- Environment variables: configuration/env-variables.md
- Administration:
- Upgrade:
- To 0.1.6: administration/upgrade/0.1.6.md
- To 0.1.5: administration/upgrade/0.1.5.md
- To 0.1.4: administration/upgrade/0.1.4.md
- To older versions: administration/upgrade/older.md
Expand Down

0 comments on commit 927d2de

Please sign in to comment.