<p>This can be done using  the <code>resave/entries</code> console command along with the <code>--set</code> and <code>--to</code> option flags.</p>
<pre><code>craft resave/entries --section sourceSectionHandle --set sectionId --to &quot;=destinationSectionId&quot;
</code></pre>
<p>This resaves all the entries in the section whose handle is 'sourceSectionHandle' and then uses the <code>--set</code> and <code>--to</code> flags to define the destination <strong>section ID</strong> of the entries, which will move them from the source section to the destination section as they're resaved.</p>
<p>You can find out the ID of the destination section you want to move the entries to by checking the URL in CP &gt; Settings &gt; Sections and edit the section. The URL looks like this:</p>
<pre><code>https://yoursite.local/admin/settings/sections/11
</code></pre>
<p>In this example, the section ID is <code>11</code>, so the resave command would look like this:</p>
<pre><code>craft resave/entries --section sourceSectionHandle --set sectionId --to &quot;=11&quot;
</code></pre>

CC BY-SA 4.0
2023-08-15T08:45:40.093Z
2023-08-15T08:45:40.093Z
Martin Spain
<p>I have two sections with the same fields. I want to move entries from one section into the other section.
There is this <a href="https://craftcms.stackexchange.com/questions/4433/move-entry-from-one-structure-to-another-with-parenting/4467#4467">post</a> but its there a better way in Craft 4?</p>

<sections><craft4>
Craft 4 move entries
# Craft 4 move entries

(Asked by: username_0 on 2023-08-11)

I have two sections with the same fields. I want to move entries from one section into the other section.
There is this [post](https://craftcms.stackexchange.com/questions/4433/move-entry-from-one-structure-to-another-with-parenting/4467#4467) but its there a better way in Craft 4?

**Tags:** sections, craft4


---

## 1 answers

### Answer by username_1 on 2023-08-15. Score: 1 | Accepted answer

This can be done using  the resave/entries console command along with the --set and --to option flags.
craft resave/entries --section sourceSectionHandle --set sectionId --to "=destinationSectionId"

This resaves all the entries in the section whose handle is 'sourceSectionHandle' and then uses the --set and --to flags to define the destination section ID of the entries, which will move them from the source section to the destination section as they're resaved.
You can find out the ID of the destination section you want to move the entries to by checking the URL in CP > Settings > Sections and edit the section. The URL looks like this:
https://yoursite.local/admin/settings/sections/11

In this example, the section ID is 11, so the resave command would look like this:
craft resave/entries --section sourceSectionHandle --set sectionId --to "=11"


---

