protected function moveNodeVariantToTargetWorkspace(NodeInterface $nodeToPublish, Workspace $targetWorkspace)
    {
        $nodeData = $nodeToPublish->getNodeData();
        $this->adjustShadowNodeDataForNodePublishing($nodeData, $targetWorkspace, $nodeData);

        // Technically this shouldn't be needed but due to doctrines behavior we need it.
        if ($nodeData->isRemoved() && $targetWorkspace->getBaseWorkspace() === null) {
            $this->nodeDataRepository->remove($nodeData);
            return;
        }

        $nodeData->setMovedTo(null);
        $nodeData->setWorkspace($targetWorkspace);
        $nodeData->setLastPublicationDateTime($this->now);
        $nodeToPublish->setNodeDataIsMatchingContext(null);
        $this->nodeService->cleanUpProperties($nodeToPublish);
    }