jimboslice 0 Posted July 5, 2011 Report Share Posted July 5, 2011 I own ubot standard edition. Currently I use ubot to setup a ton of accounts and databases on my server then I use a perl script to deploy the wordpress files to each account. The next part of my workflow is I need to go through and edit each wp-config file in each folder to match my database info. Since I think i can only do work on the web i went to a browser based ftp site and was able to get to the point where i open the wp-config file for editing. Now i need to know how to fine the current database info and replace it with the correct database info. Is there any way we can do a find and replace in a input box? Or is there some other way I should go about doing this? Quote Link to post Share on other sites
UBotBuddy 331 Posted July 5, 2011 Report Share Posted July 5, 2011 Why not process the file before you FTP it? Quote Link to post Share on other sites
jimboslice 0 Posted July 6, 2011 Author Report Share Posted July 6, 2011 I can do that but I have one standard install I do over and over again so I never ftp anything. Quote Link to post Share on other sites
JohnB 255 Posted July 6, 2011 Report Share Posted July 6, 2011 What I would do, is in the flow of the script set a variable containing that whole file...EXCEPT...where you need replacing just throw in some unique strings or characters and do a replace, or replacements just prior to uploading (You would save it to the file wp-config.php)...if that makes sense. John Quote Link to post Share on other sites
jimboslice 0 Posted July 6, 2011 Author Report Share Posted July 6, 2011 What I would do, is in the flow of the script set a variable containing that whole file...EXCEPT...where you need replacing just throw in some unique strings or characters and do a replace, or replacements just prior to uploading (You would save it to the file wp-config.php)...if that makes sense. John ok so what you are saying is to put wp-config into a variable and change the mysql info to something unique. Then to step through my csv to replace that unique mysql info with the info in my csv file that i used to set up my databases in the first place. I am able to do this in the standard edition? Ok let me add more info to this thread. I have set up my wp-config.php file to look like this:define('DB_NAME', '555841_xxxxxx'); /** MySQL database username */ define('DB_USER', '555841_vvvvvv'); /** MySQL database password */ define('DB_PASSWORD', 'cccccc'); /** MySQL hostname */ define('DB_HOST', 'aaaaaa'); since xxxxxx and so forth would be unique strings no where else in the document I should be able to edit them with my csv data. I cant wrap my head around how to do this though. Any help would be much appreciated. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.