Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
j4rdin
Worker
Worker



Joined: May 26, 2006
Posts: 153

PostPosted: Sat May 15, 2010 4:17 am Reply with quote

I have just updated to RN2.40.01 and have been reminded that I still have links on the website to images and files in the old FCKeditor upload directories. I had already copied these directories into the new upload directory in the root when I installed RN2.30.01 and need a way of finding all the old links so that they can be changed to point at the new location. I can then delete the old upload directories and tidy up the website structure.

I assume this information is all in the database and I would need to run some sort of change query in phpmyAdmin in my CPanel.

Thanks

John
 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat May 15, 2010 7:53 am Reply with quote

There is no such utility written to date that I am aware of. If I were you, if I had enough of these, why change? You cannot just easily run a SQL query (I don't think anyways) to update these. I would think a PHP script would have to be created to look at every news article and any other content areas where you have used the editor, look for the old path name and convert to the new. Not exactly a 15 minute coding job. What does it hurt to leave the old upload directory in place?

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
j4rdin







PostPosted: Sat May 15, 2010 4:03 pm Reply with quote

I haven't had a chance to try this MySQL Search & Replace Tool yet but the link to the site is here:-

http://sewmyheadon.com/2009/mysql-search-replace-tool/

Looks like it will allow you to change any instance of the text across the whole database and you can test the replace first by just returning a search list of hits.
 
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6437

PostPosted: Sat May 15, 2010 9:44 pm Reply with quote

j4rdin, thanks for posting this. I'm not able to test it now, but it certainly appears to be a viable solution if you don't want to keep the old upload folder. Thanks for the research and posting for others!

_________________
I search, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1123

PostPosted: Sun May 16, 2010 6:44 am Reply with quote

it is giving some errors. I guess we need to test it on some other hosting. I am testing it with PHP5. Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given
 
View user's profile Send private message
j4rdin







PostPosted: Sun May 16, 2010 2:02 pm Reply with quote

I have just tried running this and have got the following errors:-

Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user '******'@'localhost' (using password: NO) in /home/******/public_html/mysql-replace/mysql-replace.php on line 51

Fatal error: Access denied for user '******'@'localhost' (using password: NO) in /home/******/public_html/mysql-replace/mysql-replace.php on line 51

Not sure if this is similar to what is happening when unicornio runs it. Unfortunately I'm not very good with PHP coding so bumbling along as usual.
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Sun May 16, 2010 2:17 pm Reply with quote

@ j4ardin your error indicates an error connecting to the DB by the script - you may want to check the DB connection details/user/pass
 
View user's profile Send private message Send e-mail
j4rdin







PostPosted: Sun May 16, 2010 3:18 pm Reply with quote

I should be getting a form up in the browser to fill in the connection details to the database, but I'm not, when I run the script I get that error and no Form. I have uploaded the mysql-replace folder in the /public_html folder on the website.
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sun May 16, 2010 5:40 pm Reply with quote

To get to the form you should be going to index.php. It sounds like you are trying to go strait to mysql-replace.php

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
j4rdin







PostPosted: Fri May 21, 2010 3:42 pm Reply with quote

Palbin wrote:
To get to the form you should be going to index.php.


You had it in one, that exactly what I was doing, should try sorting these things out when I'm awake.

The script would be of more use if it only returned the tables with the search term in them and not the whole database table list.

At least then you would be able to print the list out and search only those tables when doing a search and replace. Still better than nothing.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©