Serverwide exchange of specific string in pages and sqlDBs

caylean

Active Member
Jul 2, 2013
27
0
1
cPanel Access Level
Root Administrator
Hey Guys,
I have a probleme here right now. I have just gotten 70 Domains from an old Webmaster and the transfer and everything went pretty smooth with WHM and for being a Novice like me.

Right now I am looking for a way to change in .html, .php and .htm (unlikely, but who knows) als also in all Databases some strings.
To be more precise, I wish to change "w=12345&w" to "w=54321&w" ..How can this feat be accomplished? I have no clue where I have to change these Datas all. All pages are absolutely new to me and so I will take a huge lot of time to check each and every domain. While there are like 50 Blogs with a total of like 300+ MultiUser Blogs that I would have to check manually.

Example: find . -type f | xargs -d "\n" perl -pi -e 's/w=12345&w/w=54321&w/g'
This SHOULD work I THINK... but then again, it only works with Files, but not Databases, right?

I had found some search and replace codes that could be used in SSH, but most of them were with rules that either didn't apply to me, or made no sense to me AND always seem to explude Databases. To databases I couldn't find anything that would do this process serverwide...

Is there anything I can do from WHM to accolplish that and if not are there like twi lines of code I can just hit and have all the affiliate codes that are hidden in sidebars/postings/static pages to be modified?

I would be really glad if you could help me.
 
Last edited:

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston

caylean

Active Member
Jul 2, 2013
27
0
1
cPanel Access Level
Root Administrator
So it actually looks like that there is no real way to do this from ssh? ... quite strange for me, but well, then the sql dump seems to be the easiest way for me to deal with it.

Thanks