# Rake post without confirmation

**URL:** https://meta.discourse.org/t/rake-post-without-confirmation/186487
**Category:** Self-hosting
**Created:** [April 12, 2021, 10:56am UTC](https://meta.discourse.org/t/rake-post-without-confirmation/186487 "2021-04-12T10:56:21Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Ludovik\_Dopierala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ludovik_dopierala/32/193103_2.png) [@Ludovik\_Dopierala](https://meta.discourse.org/u/Ludovik_Dopierala)
#### Post date: [April 12, 2021, 10:56am UTC](https://meta.discourse.org/t/rake-post-without-confirmation/186487/1 "2021-04-12T10:56:22Z")

</div>

Hello,

I need to play lof ot rake posts:remap

Is ti possible to force (without a confirmation Y/n) ?

thanks for help

Ludo

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 12, 2021, 1:54pm UTC](https://meta.discourse.org/t/rake-post-without-confirmation/186487/2 "2021-04-12T13:54:06Z")

</div>

I’d do it from rails and skip the rake task. [Administrative Bulk Operations](https://meta.discourse.org/t/administrative-bulk-operations/118349) might offer some hints on how to do that.

---

<div class="post-metadata">

### Author: ![Ludovik\_Dopierala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ludovik_dopierala/32/193103_2.png) [@Ludovik\_Dopierala](https://meta.discourse.org/u/Ludovik_Dopierala)
#### Post date: [April 12, 2021, 3:03pm UTC](https://meta.discourse.org/t/rake-post-without-confirmation/186487/3 "2021-04-12T15:03:23Z")

</div>

@pfaffman ok thank you I will take a look.

Basically I already have a file with more than 500 url that I need to replace :

1. rake posts:remap[“old\_url1/”,“new\_url1”]
2. rake posts:remap[“old\_url2/”,“new\_url2”]
3. etc

I will try to find how I can do with rails. But it will be great if we have switch like --force or --yes to avoid confirm.

Than you for your help

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 12, 2021, 3:49pm UTC](https://meta.discourse.org/t/rake-post-without-confirmation/186487/4 "2021-04-12T15:49:49Z")

</div>

Here’s what I’d do:

```
DbHelper.remap("old","new")

```

If you wanted to use the rake task you can try doing a `echo y| rake ...` or just edit the rake task in `./lib/tasks`

---

<div class="post-metadata">

### Author: ![Ludovik\_Dopierala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ludovik_dopierala/32/193103_2.png) [@Ludovik\_Dopierala](https://meta.discourse.org/u/Ludovik_Dopierala)
#### Post date: [April 12, 2021, 4:11pm UTC](https://meta.discourse.org/t/rake-post-without-confirmation/186487/5 "2021-04-12T16:11:23Z")

</div>

@pfaffman an error with  
DbHelper.remap(“old”,“new”)

But this work fine  
`echo y| rake posts:remap[“old_url1/”,“new_url1”]`

Than you so much.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 12, 2021, 7:29pm UTC](https://meta.discourse.org/t/rake-post-without-confirmation/186487/6 "2021-04-12T19:29:57Z")

</div>

Glad that worked. The `DbHelper` needs to be run inside rails, not the shell.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 12, 2021, 7:30pm UTC](https://meta.discourse.org/t/rake-post-without-confirmation/186487/7 "2021-05-12T19:30:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
