Difference between revisions of "WordPress Copy a Website"

m
no edit summary
m
 
Line 10: Line 10:
There are some contexts to think about when searching for text to change;
There are some contexts to think about when searching for text to change;


* Content, IE stuff that's written to be read by viewers
*Content, IE stuff that's written to be read by viewers
* Physical Directory / Path Names ( /var/www/html/WhatEverWebSiteDirectory )
*Physical Directory / Path Names ( /var/www/html/WhatEverWebSiteDirectory )
* URL Paths ( https://WhatEverDomainName )
*URL Paths ( https://WhatEverDomainName )


There's an order to search for things to modify;
There's an order to search for things to modify;


* Most specific to least specific, IE search and replace https://WhatEverDomainName before WhatEverDomainName
*Most specific to least specific, IE search and replace https://WhatEverDomainName before WhatEverDomainName


==Copy Files and Database==
==Copy Files and Database==
Line 73: Line 73:
And on frustrating note, in that the above command 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!
And on frustrating note, in that the above command 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!


<br />
==== Example ====
Check and see if anything needs to be replaced: '''grep -Ri "NEW.TerraBase.info" /var/www/html/new.TerraBase.info/* > output.txt'''
 
If there is something that needs to be replaced, run this: '''grep -Rli 'NEW.TerraBase.info' /var/www/html/NEW.TerraBase.info/wp-content --exclude=*.{dll,exe,png,jpg,webp,bcmap,z,tmp,pdf,zip,pack,idx,swf,ORIGINAL} | xargs sed -i''' 's/new.terrabase.info/www.terrabase.info/g'
 
..and run the first command to see if anything remains


===Speed Note===
===Speed Note===