PDA

View Full Version : How best to convert to the new mysql name!


omegaman66
8-22-07, 03:54 PM
I have a number of mysql database driven apps that run under a few diffrent account. Store/blog/message board/ etc.

Is there an easy way for me to update to the new nomenclature. Like a global find and replace done on the server. Maybe someone more knowledgeable than I could write a php script that we could edit with the 'old' and 'new" mysql database names and have all that need replacing be replaced.

Any other suggestions ideas???

phlembol
8-22-07, 04:09 PM
The answer would depend on which apps you are using.

In my own case I have 1) ZenCart - there are 2 config files that contain this info and that should be all that is required. And 2) WordPress - there is only one config file to change.

Most current apps should have this info in a single config file.

omegaman66
8-22-07, 04:56 PM
OK I change one of the mysql apps config file but how can I tell if it is working or not?

omegaman66
8-22-07, 05:31 PM
Doing it all manually. The above post is sort of my attempt at humor. With the upgrade going on getting the pages to load is nearly impossible.

YvetteKuhns
8-22-07, 09:19 PM
You should backup your scripts on your computer. You can use a Find and Replace program (I believe Dreamweaver has this) or even Find in Windows where you search for files *.* containing the text "your old database name". You can open those files in Notepad and Find your old database name and replace with the new database name.

I have a search and replace program that searches and replaces all files in a specified folder. If you don't know where the files are, you could use Windows Find to find them.

I remember doing updates for a site that needed updates in four files in different folders. You have to remember all four or search for them. ;)

omegaman66
8-22-07, 09:34 PM
I have them backed up but the databases are on multiple account and since I didn't write the phpbb, gallery2 etc I don't know where the database info is stored off hand. And each one is on a different server. Was just hoping there would be a simple program to search and replace the files online so that I wouldn't have to do it myself.

I have upgraded all of my sites to the new nomenclature by searching my drive and replacing all. I too have a search within files for text that works great.

Problem is I probably should have waited. All my stuff is basically unresponsive 95% of the time. (aagggghhhhhh). So if I messed one of the db references up how will I know.

I want my old powweb back! I have been way more loyal than I should have. I have now moved into the realm of feeling like an idiot for staying. I manage other websites for friends and I have NEVER seen any of their sites have any trouble at all. ZERO!

YvetteKuhns
8-22-07, 09:38 PM
Was just hoping there would be a simple program to search and replace the files online so that I wouldn't have to do it myself.

Advanced Find and Replace with Batch Processing (http://www.hotscripts.com/Detailed/58367.html)

I want my old powweb back! I have been way more loyal than I should have.

Me, too.

Doc C
8-22-07, 11:31 PM
Old PowWeb is long gone and it's not coming back. Life's too short to be where you're not happy. Just make sure to ask the bouncer for a refund when you walk out the door. :)

djrobx
8-23-07, 07:04 PM
Almost any sensibly written script will keep the database connection string in just one commonly included place.

If you have multiple scripts as others have said, always a good idea to backup anyway, so download the whole ball of wax then do a global search on your computer.

HalfaBee
8-23-07, 08:16 PM
A quick php script to find all mysql references in files & dir's in the current dir.

<?
echo "<pre>";
exec( 'grep -R -emysql...powweb.com *' , $s ) ;
print_r( $s );
?>

hopefire
8-24-07, 01:06 AM
So what will happen if you don't switch to the new sql names?

I hate to "fix something that aint broke"

IanS
8-24-07, 05:44 AM
So what will happen if you don't switch to the new sql names?

I hate to "fix something that aint broke"At some point they will switch off the server names and you'll have no site working much as happened long after the migration. Those that didn't switch eventually lost their site.