diff --git a/changelogs/unreleased/fix-import-export-build-token.yml b/changelogs/unreleased/fix-import-export-build-token.yml
new file mode 100644
index 0000000000000000000000000000000000000000..622487e682971bdfdda57c29f27a15ef6879c623
--- /dev/null
+++ b/changelogs/unreleased/fix-import-export-build-token.yml
@@ -0,0 +1,4 @@
+---
+title: Fix Import/Export duplicated builds error
+merge_request: 
+author: 
diff --git a/lib/gitlab/import_export/relation_factory.rb b/lib/gitlab/import_export/relation_factory.rb
index a0e80fccad9295c903e2fef142ebecc77251f3e7..9b590bcee8d7918a0ee29ff135bc98f986185faa 100644
--- a/lib/gitlab/import_export/relation_factory.rb
+++ b/lib/gitlab/import_export/relation_factory.rb
@@ -99,6 +99,8 @@ module Gitlab
       def generate_imported_object
         if BUILD_MODELS.include?(@relation_name) # call #trace= method after assigning the other attributes
           trace = @relation_hash.delete('trace')
+          @relation_hash.delete('token')
+
           imported_object do |object|
             object.trace = trace
             object.commit_id = nil
diff --git a/spec/lib/gitlab/import_export/project.json b/spec/lib/gitlab/import_export/project.json
index ed9df468cede2a66f28fa23296655a79b553eb0c..1e5901651aed8c5189b25895a71367d60d4efe8b 100644
--- a/spec/lib/gitlab/import_export/project.json
+++ b/spec/lib/gitlab/import_export/project.json
@@ -6548,7 +6548,9 @@
             "url": null
           },
           "erased_by_id": null,
-          "erased_at": null
+          "erased_at": null,
+          "type": "Ci::Build",
+          "token": "abcd"
         },
         {
           "id": 72,
diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
index 3038ab53ad8bf945769ab7559ecafe213dd0de54..13f593fb2db2070bbe5b96b51d47b1ef2063822e 100644
--- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
@@ -189,6 +189,14 @@ describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do
           end
         end
       end
+
+      context 'existing builds' do
+        it 'do not throw errors' do
+          create(:ci_build, token: 'abcd')
+
+          expect(restored_project_json).to be true
+        end
+      end
     end
   end
 end