Hello,
I need to play lof ot rake posts:remap
Is ti possible to force (without a confirmation Y/n) ?
thanks for help
Ludo
In a self-hosting support thread titled ‘Rake post without confirmation,’ Ludovik_Dopierala seeks to automate the rake posts:remap command for over 500 URL replacements without manual confirmation prompts. pfaffman suggests bypassing the rake task by using Rails directly via DbHelper.remap("old","new"), referencing Administrative Bulk Operations for guidance. Ludovik_Dopierala confirms the need for a --force or --yes flag and plans to explore Rails. pfaffman offers a workaround: echo y | rake posts:remap["old_url1/","new_url1"], or editing the rake task directly in ./lib/tasks. Ludovik_Dopierala reports that DbHelper.remap fails outside Rails but confirms the echo y | rake method works successfully. pfaffman clarifies that DbHelper must be executed within a Rails console, not the shell. The thread concludes with a functional workaround for batch URL remapping without interactive confirmation.
Hello,
I need to play lof ot rake posts:remap
Is ti possible to force (without a confirmation Y/n) ?
thanks for help
Ludo
I’d do it from rails and skip the rake task. Administrative Bulk Operations might offer some hints on how to do that.
@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 :
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
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
@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.
Glad that worked. The DbHelper needs to be run inside rails, not the shell.