Answers.Body: <p>You can prune revisions using the <a href="https://craftcms.com/docs/3.x/console-commands.html#utils-prune-revisions" rel="nofollow noreferrer"><code>utils/prune-revisions</code> CLI command</a>. This one takes a <code>--max-revisions</code> argument you can set to 0 to prune all revisions.</p>
  <pre class="lang-bash prettyprint-override"><code>php craft utils/prune-revisions --max-revisions=0
  </code></pre>
  <p>You can also use <code>--dry-run</code> to see what the command would do before actually executing it.</p>
  <p>As far as I can tell, this method does not have an option to only prune revisions for a specific section. Might be a useful addition, maybe post this as a feature request in the <a href="https://github.com/craftcms/cms/discussions" rel="nofollow noreferrer">discussions section on Github</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-24T14:23:04.943Z
Answers.Text: Im still running into memory issues with this task. Even open the entry and saving it doesn't execute and index update so the field is not searchable on
Answers.UserDisplayName: joomkit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-24T14:28:06.973Z
Answers.Text: @joomkit Hm, not sure, maybe resaving all entries is just too much, especially if you have a low memory limit. Maybe try it in multiple batches, you can specify `--limit` and `--offset` parameter for that: https://craftcms.com/docs/3.x/console-commands.html#resave-entries
Answers.UserDisplayName: MoritzLost
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-24T15:09:05.463Z
Answers.Text: DOH perfect that has enabled me to achieve the indexing. Funny it chokes before starting
Answers.UserDisplayName: joomkit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-24T10:05:45.503Z
Answers.LastActivityDate: 2022-02-24T10:05:45.503Z
Answers.UserDisplayName: MoritzLost
Body: <p>I have a section that i have changed from versioning to switching git off as I do not need them. I have also changed a field adding it as searchable.</p>
  <p>In order to reindex search field i tried CLI resave/entries. [section] but go a memory error. It reports 56K entries but there are only 12k.</p>
  <p>So i assumed this is the versions. Now I have changed section settings how do i get rid of the versions and resave to index field?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-24T10:02:50.680Z
Comments.Text: What do you mean by switching git off? You mean you turned off the revision function for this section? This has nothing to do with git. Also, resave/entries shouldn't save revisions, so it's likely it's finding entries from other sections as well.
Comments.UserDisplayName: MoritzLost
Tags: <sections><entry-versions><reindex>
Title: How do i remove versions from a section after changing section settings to not store versions?
ThreadText: # How do i remove versions from a section after changing section settings to not store versions?
  
  (Asked by: username_0 on 2022-02-24)
  
  I have a section that i have changed from versioning to switching git off as I do not need them. I have also changed a field adding it as searchable.
  
  In order to reindex search field i tried CLI resave/entries. [section] but go a memory error. It reports 56K entries but there are only 12k.
  
  So i assumed this is the versions. Now I have changed section settings how do i get rid of the versions and resave to index field?
  
  **Tags:** sections, entry-versions, reindex
  
  > **Comments:**
  > **username_1**: What do you mean by switching git off? You mean you turned off the revision function for this section? This has nothing to do with git. Also, resave/entries shouldn't save revisions, so it's likely it's finding entries from other sections as well.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-02-24. Score: 3 | Accepted answer
  
  You can prune revisions using the [`utils/prune-revisions` CLI command](https://craftcms.com/docs/3.x/console-commands.html#utils-prune-revisions). This one takes a `--max-revisions` argument you can set to 0 to prune all revisions.
  
  ```bash
  php craft utils/prune-revisions --max-revisions=0
  
  ```
  
  You can also use `--dry-run` to see what the command would do before actually executing it.
  
  As far as I can tell, this method does not have an option to only prune revisions for a specific section. Might be a useful addition, maybe post this as a feature request in the [discussions section on Github](https://github.com/craftcms/cms/discussions).
  
  > **Comments:**
  > **username_0**: Im still running into memory issues with this task. Even open the entry and saving it doesn't execute and index update so the field is not searchable on  
  > **username_1**: @username_0 Hm, not sure, maybe resaving all entries is just too much, especially if you have a low memory limit. Maybe try it in multiple batches, you can specify `--limit` and `--offset` parameter for that: https://craftcms.com/docs/3.x/console-commands.html#resave-entries  
  > **username_0**: DOH perfect that has enabled me to achieve the indexing. Funny it chokes before starting  
  
  ---
  
  