Skip to content

Commit ac0d6f1

Browse files
caitlinwheelesscaitlinwheelessjombooth
authored
docs: OPTIC-340: Add page on upgrading Label Studio Community (#6714)
Co-authored-by: caitlinwheeless <[email protected]> Co-authored-by: Jo Booth <[email protected]>
1 parent 816372a commit ac0d6f1

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed
+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
title: Upgrade Label Studio
3+
type: guide
4+
tier: opensource
5+
order: 96
6+
order_enterprise: 0
7+
meta_title: Upgrade Label Studio Community Edition
8+
meta_description: Documentation for upgrade paths and commands for Label Studio.
9+
section: "Install & Setup"
10+
---
11+
12+
When upgrading Label Studio, keep the following in mind:
13+
14+
- **Backup Your Data**: Before starting the upgrade, make sure to back up your existing projects, databases, and any custom configurations.
15+
- **Review Release Notes**: Check [the release notes](https://github.com/HumanSignal/label-studio/releases) for the version you're upgrading to. Pay attention to any breaking changes or migration steps that may be required.
16+
- **Python Compatibility**: Ensure that your Python version is compatible with the new Label Studio release. Label Studio supports Python 3.9 through 3.13. Using an incompatible Python version can lead to installation errors.
17+
- **Check for Dependency Issues**: After upgrading, verify that all dependencies are correctly installed. If you encounter missing package errors, you might need to install those packages manually. Running Label Studio in a clean Python environment or virtual environment can reduce the likelihood of package conflicts.
18+
- **Test Your Setup**: After upgrading, test your Label Studio instance to ensure everything works as expected. Check key functionalities like task loading, labeling interfaces, data export, and any integrations you use.
19+
- **Troubleshoot Installation Issues**: If you encounter any issues during the upgrade, see [Troubleshoot installation issues](install_troubleshoot).
20+
21+
22+
23+
## Upgrade using pip
24+
25+
```bash
26+
pip install --upgrade label-studio
27+
```
28+
29+
30+
## Upgrade using Docker
31+
32+
1. Stop the existing Label Studio container:
33+
```bash
34+
docker ps # Find the container ID or name
35+
docker stop <container_id_or_name>
36+
```
37+
2. Pull the latest Label Studio Docker image:
38+
```bash
39+
docker pull heartexlabs/label-studio:latest
40+
```
41+
3. Start a new container with the latest image, using the same volume mappings as before:
42+
```bash
43+
docker run -it -p 8080:8080 \
44+
-v /path/to/yourdata:/label-studio/data \
45+
-v /path/to/yourfiles:/label-studio/files \
46+
heartexlabs/label-studio:latest
47+
```
48+
Replace `/path/to/yourdata` and /`path/to/yourfiles` with the actual paths you used previously.
49+
4. Run database migrations (if necessary).
50+
51+
If you encounter any issues after upgrading, you might need to run database migrations:
52+
53+
```bash
54+
docker exec -it <container_id_or_name> bash
55+
cd /label-studio
56+
python manage.py migrate
57+
```
58+
5. Open Label Studio in your browser at `http://localhost:8080` and check that your projects and data are accessible.
59+
60+
61+
## Upgrade after installing from source
62+
63+
If you installed Label Studio [using the source in Github](https://github.com/HumanSignal/label-studio), you can upgrade using the following steps.
64+
65+
<div class="code-tabs">
66+
<div data-name="Using Poetry (recommended)">
67+
68+
If you're using Poetry ([see these instructions](install#Install-from-source)), upgrade with the following steps:
69+
70+
1. Navigate to your Label Studio directory (where you cloned the repository).
71+
2. Fetch the latest changes from the repository:
72+
```bash
73+
git pull
74+
```
75+
3. If you want to upgrade to a specific version, list available tags and checkout the desired one. For example, to upgrade to version 1.14.0:
76+
```bash
77+
git fetch --tags
78+
git checkout v1.14.0
79+
```
80+
4. Install updated dependencies using Poetry:
81+
```bash
82+
poetry install
83+
```
84+
5. Run database migrations to apply any updates to the database schema:
85+
```bash
86+
poetry run python label_studio/manage.py migrate
87+
```
88+
6. Collect static files:
89+
```bash
90+
poetry run python label_studio/manage.py collectstatic
91+
```
92+
7. Restart Label Studio:
93+
```bash
94+
poetry run python label_studio/manage.py runserver
95+
```
96+
97+
</div>
98+
<div data-name="Using pip">
99+
100+
1. Navigate to your Label Studio directory (where you cloned the repository).
101+
2. Fetch the latest changes from the repository:
102+
```bash
103+
git pull
104+
```
105+
1. If you want to upgrade to a specific version, list available tags and checkout the desired one. For example, to upgrade to version 1.14.0:
106+
```bash
107+
git fetch --tags
108+
git checkout v1.14.0
109+
```
110+
1. Install updated dependencies:
111+
```bash
112+
pip install -r requirements.txt
113+
```
114+
1. Run database migrations to apply any updates to the database schema:
115+
```bash
116+
python label_studio/manage.py migrate
117+
```
118+
1. Collect static files:
119+
```bash
120+
python label_studio/manage.py collectstatic
121+
```
122+
1. Restart Label Studio:
123+
```bash
124+
python label_studio/manage.py runserver
125+
```
126+
127+
</div>
128+
</div>
129+
130+
## Upgrade a Kubernetes installation
131+
132+
See [Upgrade Label Studio using Helm](install_k8s#Upgrade-Label-Studio-using-Helm).

0 commit comments

Comments
 (0)