Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>Better Alternative for WordPress Migrations</h2> <p>If you are moving your website and you will want to replace all references to the old site with the new domain, I suggest you use <a href="http://interconnectit.com/products/search-and-replace-for-wordpress-databases/" rel="nofollow">David Coveney's Serialized Search &amp; Replace DB v2.1.0</a>. You'll want to run this on a new copy of the database, always have a backup handy. Import the database on the destination server, then run the tool - You don't even have to upload the server files.</p> <p>When I do this coming from a development server to live domain, I usually do two search &amp; replaces:</p> <p>One for URLs, very basic:</p> <pre><code>Search: mywebsite.devserver.com Replace: my-new-website.com </code></pre> <p>And one for file paths:</p> <pre><code>Search: /vhosts/devserver.com/mywebsite Replace: /vhosts/my-new-website.com/httpdocs (Note: This is assuming the majority of the file path is the same for both servers. Your search &amp; replace paths may need to be more accurate) </code></pre> <p>The reason you want <strong>serialized</strong> search and replace is that some data is stored in PHP-serialized format, and if you change the value with a text editor or in MySQL directly, it may not be able to unserialize afterwards.</p> <hr> <h2>Regex Answer</h2> <p>Select images hosted by blog.example.com with the following regex pattern: </p> <p><code>((http|https)://blog\.example.com/[^ \r\n]+\.(jpg|jpeg|png|gif))</code></p> <p>Which basically searches for this: <code>http(s)://blog.example.com/*.(jpg/png/etc)</code></p> <p><strong>Matches the URLs in the following examples:</strong></p> <pre><code>http://example.com/imagename.jpg http://blog.example.com/imagename.jpg http://blog.example.com/favicon.png http://blog.example.com/uploads/2013/05/kitten.gif https://blog.example.com/ssl-secure.png This is my favorite gif https://blog.example.com/some-hilarious-image.gif hahaha </code></pre> <p><strong>DOES NOT match any of these:</strong></p> <pre><code>blog.example.com/google.png https://blog.google.com/google.png our website is http://blog.example.com and has an image named /imagename.png http://blog.example.com/ </code></pre> <p><strong>WHY it doesn't match those (by line):</strong></p> <pre><code>Does not include http(s):// Hosted by google Paragraph text, where the URL is split into two parts Not an image </code></pre> <p><code>$1</code> returns the full URL of the image.</p> <p>I tested this on <a href="http://www.regextester.com/" rel="nofollow">RegexTester.com</a>. You can copy the pattern in the top field, and all of the examples in the box below. The red highlights are matches.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload