Skip to content

Multi-Site Section or Section duplication #10595

Answered by brandonkelly
miriamborgers asked this question in Q&A
Discussion options

You must be logged in to vote

If the new version of the site is going to be replacing the current version, and they are not meant to live alongside each other in the long run, then option 1 makes the most sense to me.

I think we’ll have to do that manually though, which means doing it for 600 entries… 😬

Is there anything in the entries that could be used to identify which entries need to be added to the English site? If so you could write a script to automate it:

use craft\elements\Entry;

$deSite = Craft::$app->sites->getSiteByHandle('deSiteHandle');
$enSite = Craft::$app->sites->getSiteByHandle('enSiteHandle');

$entries = Entry::find()
    // params...
    ->siteId($deSite->id)
    ->all();

foreach ($entries as $e…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by brandonkelly
Comment options

You must be logged in to vote
2 replies
@brandonkelly
Comment options

@jannisborgers
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants