Skip to content

Django 4 Upgrades (version < 1.23.0)

After upgrading from Codabench <1.23.0, you will need to perform manual interventions.

DjangoΒΆ

The Django version upgrade will require all the containers to be rebuilt:

docker compose build --no-cache
docker compose up -d

Afterward, you will need to run some migrations:

docker compose exec django python manage.py migrate
If it asks you to do a makemigration instead, you will have to run the following command:
docker compose exec django python manage.py makemigrations --merge
You might need to modify /app/src/apps/datasets/migrations/0014_merge_20251212_0942.py to remove the datagroup changes
# Generated by Django 4.2.23 on 2025-09-08 12:32

from django.db import migrations, models
import utils.data
import utils.storage

class Migration(migrations.Migration):

        dependencies = [
            ("datasets", "0010_auto_20250218_1100"),
        ]

        operations = [
            migrations.AlterField(
                model_name="data",
                name="data_file",
                field=models.FileField(
                    blank=True,
                    null=True,
                    storage=utils.storage.PrivateStorageClass(),
                    upload_to=utils.data.PathWrapper("dataset"),
                ),
            ),
            migrations.AlterField(
                model_name="data",
                name="id",
                field=models.BigAutoField(
                    auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                ),
            ),
        ]
Notice that there are only two migrations in this file instead of 3. Simply delete the last one (it tries to change datagroups even after datagroups was deleted, which is why it fails)