def _copy_project(self, project, new_project_name, path_filter):
        """
        Copy pre-existing project with name project_name to non-existing project new_project_name.
        :param project: remotestore.RemoteProject project to copy from
        :param new_project_name: str project to copy to
        :param path_filter: PathFilter: filters what files are shared
        :return: RemoteProject new project we copied data to
        """
        temp_directory = tempfile.mkdtemp()
        new_project_name_or_id = ProjectNameOrId.create_from_name(new_project_name)
        remote_project = self.remote_store.fetch_remote_project(new_project_name_or_id)
        if remote_project:
            raise ValueError("A project with name '{}' already exists.".format(new_project_name))
        activity = CopyActivity(self.remote_store.data_service, project, new_project_name)
        self._download_project(activity, project, temp_directory, path_filter)
        self._upload_project(activity, new_project_name, temp_directory)
        activity.finished()
        shutil.rmtree(temp_directory)
        return self.remote_store.fetch_remote_project(new_project_name_or_id, must_exist=True)