public function duplicateToSubsitePrep($subsiteID, $includeChildren)
    {
        if (is_object($subsiteID)) {
            $subsiteID = $subsiteID->ID;
        }

        return SubsiteState::singleton()
            ->withState(function (SubsiteState $newState) use ($subsiteID, $includeChildren) {
                $newState->setSubsiteId($subsiteID);

                /** @var SiteTree $page */
                $page = $this->owner;

                try {
                    // We have no idea what the ParentID should be, but it shouldn't be the same as it was since
                    // we're now in a different subsite. As a workaround use the url-segment and subsite ID.
                    if ($page->Parent()) {
                        $parentSeg = $page->Parent()->URLSegment;
                        $newParentPage = Page::get()->filter('URLSegment', $parentSeg)->first();
                        $originalParentID = $page->ParentID;
                        if ($newParentPage) {
                            $page->ParentID = (int) $newParentPage->ID;
                        } else {
                            // reset it to the top level, so the user can decide where to put it
                            $page->ParentID = 0;
                        }
                    }

                    // Disable query filtering by subsite during actual duplication
                    $originalFilter = Subsite::$disable_subsite_filter;
                    Subsite::disable_subsite_filter(true);

                    return $includeChildren ? $page->duplicateWithChildren() : $page->duplicate(false);
                } finally {
                    Subsite::disable_subsite_filter($originalFilter);

                    // Re-set the original parent ID for the current page
                    $page->ParentID = $originalParentID;
                }
            });
    }