Author |
Message |
j4rdin
Worker
Joined: May 26, 2006
Posts: 153
|
Posted:
Sat May 15, 2010 4:17 am |
|
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 |
|
|
|
|
montego
Site Admin
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Sat May 15, 2010 7:53 am |
|
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! |
|
|
|
j4rdin
|
Posted:
Sat May 15, 2010 4:03 pm |
|
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
|
Posted:
Sat May 15, 2010 9:44 pm |
|
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! |
|
|
|
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm
Joined: Aug 13, 2009
Posts: 1123
|
Posted:
Sun May 16, 2010 6:44 am |
|
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 |
|
|
|
|
j4rdin
|
Posted:
Sun May 16, 2010 2:02 pm |
|
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
|
Posted:
Sun May 16, 2010 2:17 pm |
|
@ j4ardin your error indicates an error connecting to the DB by the script - you may want to check the DB connection details/user/pass |
|
|
|
|
j4rdin
|
Posted:
Sun May 16, 2010 3:18 pm |
|
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
|
Posted:
Sun May 16, 2010 5:40 pm |
|
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. |
|
|
|
j4rdin
|
Posted:
Fri May 21, 2010 3:42 pm |
|
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. |
|
|
|
|
|