Difference between revisions of "WordPress Copy a Website"

Wiki.TerraBase.info
Jump to navigation Jump to search
m
m
Line 2: Line 2:


It's a lot like 'moving' a WordPress website, but with some extra stuff.
It's a lot like 'moving' a WordPress website, but with some extra stuff.
<nowiki>*</nowiki>.dll, *.exe, *.png, *.jpg, *.webp, *.bcmap, *.z, *.tmp, *.pdf, *.zip, *.pack, *.idx, *.swf, *.ORIGINAL


==File Contents==
==File Contents==
Line 14: Line 12:
**Suggested Settings: Case Sensitive (turn it ON)
**Suggested Settings: Case Sensitive (turn it ON)


=== Utilities (for WordPress) ===
===Utilities (for WordPress)===


*String Locator
*String Locator
Line 25: Line 23:
**-i = Ignore Case (IE, make the string that is being searched for Case Insensitive)
**-i = Ignore Case (IE, make the string that is being searched for Case Insensitive)
**-l = Only list the File Names that contain the searched for strings in the results (That's an L (El), not an I (eye) for the switch)
**-l = Only list the File Names that contain the searched for strings in the results (That's an L (El), not an I (eye) for the switch)
...but, don't want to just find strings, want to replace them, so;
* grep -rl 'WhatEverTextPatternToBeReplaced' /var/www/html/www.RiseOfTheSaltonSea.com --exclude=*.{dll,exe,png,jpg,webp,bcmap,z,tmp,pdf,zip,pack,idx,swf,ORIGINAL} | xargs sed -i 's/WhatEverTextPatternToBeReplaced/WhatEverNewTextPattern/g'
...and with a frustrating note, in that the above doesn't account for spaces (if there are any, in file names and directory names).  Couldn't find a solution as grep simply will not produce any output, even with --null and / or -Z that xargs -0 will pay attention to.  Woof!

Revision as of 18:12, 30 May 2022

If you've got the perfect WordPress website and want to copy it, here's how to do it. Perfect here is more focused on the backend and administrative stuff, not the content of the site. IE, Plugins, custom themes, and other customizations, etc.

It's a lot like 'moving' a WordPress website, but with some extra stuff.

File Contents

Utilities (for Windows)

  • Advanced Find and Replace ($)
  • Find and Replace (Free, with requested donations)
    • Suggested Exclude Mask: *.dll, *.exe, *.png, *.jpg, *.webp, *.bcmap, *.z, *.tmp, *.pdf, *.zip, *.pack, *.idx, *.swf, *.ORIGINAL
    • Suggested Settings: Case Sensitive (turn it ON)

Utilities (for WordPress)

  • String Locator

Commands

  • This command will locate strings within files;
    • grep -Ril WhatEverStringToSearchFor WhatEverPathToSearch
    • -R = Recursive (IE, search sub-directories)
    • -i = Ignore Case (IE, make the string that is being searched for Case Insensitive)
    • -l = Only list the File Names that contain the searched for strings in the results (That's an L (El), not an I (eye) for the switch)

...but, don't want to just find strings, want to replace them, so;

  • grep -rl 'WhatEverTextPatternToBeReplaced' /var/www/html/www.RiseOfTheSaltonSea.com --exclude=*.{dll,exe,png,jpg,webp,bcmap,z,tmp,pdf,zip,pack,idx,swf,ORIGINAL} | xargs sed -i 's/WhatEverTextPatternToBeReplaced/WhatEverNewTextPattern/g'

...and with a frustrating note, in that the above doesn't account for spaces (if there are any, in file names and directory names). Couldn't find a solution as grep simply will not produce any output, even with --null and / or -Z that xargs -0 will pay attention to. Woof!