diff --git a/db/docs/batched_background_migrations/backfill_dast_profiles_pipelines_project_id.yml b/db/docs/batched_background_migrations/backfill_dast_profiles_pipelines_project_id.yml
index 3188116478f5e7ced32af0a9b95ed315f6f8af77..67f220de81466cd3e3c747799406a20d537f5011 100644
--- a/db/docs/batched_background_migrations/backfill_dast_profiles_pipelines_project_id.yml
+++ b/db/docs/batched_background_migrations/backfill_dast_profiles_pipelines_project_id.yml
@@ -6,4 +6,4 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167633
 milestone: '17.5'
 queued_migration_version: 20240930143922
 finalize_after: '2024-10-22'
-finalized_by: # version of the migration that finalized this BBM
+finalized_by: '20241027232352'
diff --git a/db/post_migrate/20241027232352_finalize_backfill_dast_profiles_pipelines_project_id.rb b/db/post_migrate/20241027232352_finalize_backfill_dast_profiles_pipelines_project_id.rb
new file mode 100644
index 0000000000000000000000000000000000000000..afaee1d3c97918fecc92024e6acfc1a9444a7e87
--- /dev/null
+++ b/db/post_migrate/20241027232352_finalize_backfill_dast_profiles_pipelines_project_id.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class FinalizeBackfillDastProfilesPipelinesProjectId < Gitlab::Database::Migration[2.2]
+  milestone '17.6'
+
+  disable_ddl_transaction!
+
+  restrict_gitlab_migration gitlab_schema: :gitlab_sec
+
+  def up
+    ensure_batched_background_migration_is_finished(
+      job_class_name: 'BackfillDastProfilesPipelinesProjectId',
+      table_name: :dast_profiles_pipelines,
+      column_name: :ci_pipeline_id,
+      job_arguments: [:project_id, :dast_profiles, :project_id, :dast_profile_id],
+      finalize: true
+    )
+  end
+
+  def down; end
+end
diff --git a/db/schema_migrations/20241027232352 b/db/schema_migrations/20241027232352
new file mode 100644
index 0000000000000000000000000000000000000000..f58f1a4a166c2f6c88f98a83650bcd9d186512d7
--- /dev/null
+++ b/db/schema_migrations/20241027232352
@@ -0,0 +1 @@
+8410c817c8e29df224710914b172504b3af04468bd724ecd1349b739eb4d7fbb
\ No newline at end of file