diff --git a/api/funkwhale_api/common/scripts/migrate_to_user_libraries.py b/api/funkwhale_api/common/scripts/migrate_to_user_libraries.py
index 54ba5d503f1dbea5fbd080cc1033ee352df527ed..537794b6275e7db4c3d34db8be75a48fa18b64c9 100644
--- a/api/funkwhale_api/common/scripts/migrate_to_user_libraries.py
+++ b/api/funkwhale_api/common/scripts/migrate_to_user_libraries.py
@@ -71,7 +71,15 @@ def update_uploads(libraries_by_user, stdout):
 
 def update_orphan_uploads(open_api, stdout):
     privacy_level = "everyone" if open_api else "instance"
-    first_superuser = User.objects.filter(is_superuser=True).order_by("pk").first()
+    first_superuser = (
+        User.objects.filter(is_superuser=True)
+        .exclude(actor=None)
+        .order_by("pk")
+        .first()
+    )
+    if not first_superuser:
+        stdout.write("* No superuser found, skipping update orphan uploads")
+        return
     library, _ = models.Library.objects.get_or_create(
         name="default",
         actor=first_superuser.actor,
diff --git a/api/funkwhale_api/users/models.py b/api/funkwhale_api/users/models.py
index 197ef0dc8bc5aad03bcb0bd3105817702bd9278e..2bc87588ef0ab235ec51bce6270770148c905641 100644
--- a/api/funkwhale_api/users/models.py
+++ b/api/funkwhale_api/users/models.py
@@ -285,7 +285,7 @@ def create_actor(user):
     args["private_key"] = private.decode("utf-8")
     args["public_key"] = public.decode("utf-8")
 
-    return federation_models.Actor.objects.create(**args)
+    return federation_models.Actor.objects.create(user=user, **args)
 
 
 @receiver(ldap_populate_user)
diff --git a/docs/upgrading/0.17.rst b/docs/upgrading/0.17.rst
index 4a7093b1fa8024a3e3cb550bc58ded1ae2dada42..1414b563ed9b90d3f2c2a761d5c9f84eba84c0f5 100644
--- a/docs/upgrading/0.17.rst
+++ b/docs/upgrading/0.17.rst
@@ -189,10 +189,14 @@ then run the migrations script.
 
 On docker-setups::
 
+    # if you missed this one from a previous upgrade
+    docker-compose run --rm api python manage.py script create_actors --no-input
     docker-compose run --rm api python manage.py script migrate_to_user_libraries --no-input
 
 On non docker-setups::
 
+    # if you missed this one from a previous upgrade
+    python api/manage.py script create_actors --no-input
     python api/manage.py script migrate_to_user_libraries --no-input
 
 If the scripts ends without errors, you're instance should be updated and ready to use :)