# Rake posts:remap - 0 posts remapped!

**URL:** <https://meta.discourse.org/t/rake-posts-remap-0-posts-remapped/140364>\
**Category:** Self-hosting\
**Created:** [February 1, 2020, 9:56am UTC](https://meta.discourse.org/t/rake-posts-remap-0-posts-remapped/140364 "2020-02-01T09:56:01Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Amethi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amethi/32/88690_2.png) [@Amethi](https://meta.discourse.org/u/Amethi)\
**Post date:** [February 1, 2020, 9:56am UTC](https://meta.discourse.org/t/rake-posts-remap-0-posts-remapped/140364/1 "2020-02-01T09:56:01Z")

</div>

I’m trying to find and replace some broken images left over from our forum migration to Discourse and have had great success (love the remap command!) but it’s not finding anything to replace for these examples and I can’t see anything wrong, can you?

Example content:

`<img src="https://londonbikers.com/images/transparent.png" alt="PICT0738.JPG" data-orig-src="upload://1yz82u6bbkaAQ7xP06qNTmX9qy3.JPG" width="666" height="500" class="d-lazyload">`

and

`<img src="https://londonbikers.com/images/transparent.png" alt="Rhonda.JPG" data-orig-src="upload://vXQ67D17QssTe5cu6lamJ5XB5Ep.JPG" width="590" height="500" class="d-lazyload">`

I need to do this in two passes as I need to keep the alt tag contents and rebuild the img element around it. It’s failing on the first remap:

i.e. FIND:  
`<img src="https://londonbikers.com/images/transparent.png" alt="`

and REPLACE with:  
`<img src="https://londonbikersarchive.blob.core.windows.net/forum-attachments/`

I’ve assumed double quotes need to be escaped with a backslash? So have used this command:

`rake posts:remap["<img src=\"https://londonbikers.com/images/transparent.png\" alt=\"","<img src=\"https://londonbikersarchive.blob.core.windows.net/forum-attachments/"]`

But I get told **0 posts remapped!** when there are thousands of such posts with those elements in. Any ideas?

My second pass would then be to remap the end of the tag from:  
`width="666" height="500" class="d-lazyload">`

to:  
`/>`

---

_[View the full topic](https://meta.discourse.org/t/rake-posts-remap-0-posts-remapped/140364)._
