Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 07 Mar 2005, 07:49
David_R David_R is offline
 
Join Date: Mar 2005
Real name: David RutherFord
Question Replace old URL with new URL from entire Database

Hi,
We recently changed our forums url from www.olddomain.com to www.newdomain.com
We are using olddomain.com for more then 2 years and there are lots of posts, pms, internallly which contain those urls.

Is there a way to replace this from entire database ?
I know this can be done manually downloading the entire 800 MB database and removing those entries manually.
I am looking for an automated procedure.

we have following urls to be replace.
www.oldomain.com
olddomain.com
www.olddomain.com/forum
forum.olddomain.com

thank you.
Reply With Quote
  #2  
Old 07 Mar 2005, 11:52
Brad Brad is offline
 
Join Date: Nov 2001
Run this SQL query:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


For pm's this SQL query:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Note that query is very intensive, you should back-up your db before using it. It may very well screw up a lot of your posts/pms/entire database.

Remember to re-build the postcache if you use it, or the changes will not apper right away.

Last edited by Brad.loo; 07 Mar 2005 at 11:56.
Reply With Quote
  #3  
Old 07 Mar 2005, 17:02
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Real name: Dean Clatworthy
Oh wow, I never knew about that MySQL function
__________________
Dean Clatworthy - Web Developer/Designer
Reply With Quote
  #4  
Old 08 Mar 2005, 06:48
David_R David_R is offline
 
Join Date: Mar 2005
Real name: David RutherFord
Question ThankYou Sir Brad.loo

thankyou very much for posting the easy solution here.
some questions.

Text to be replaced was our olddomain name, it used extensively across the database. In code tags, html tags, php tags, signatures, posts, pms, notes, every possible end-user area,

As suggested by you.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This will replace www.olddomain.com with www.newdomain.com ?

To execute other replacements:
olddomain.com
www.olddomain.com/forum
forum.olddomain.com
I assume I will only need to run 1 additional line:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

?
Reply With Quote
  #5  
Old 08 Mar 2005, 14:02
Guy G Guy G is offline
 
Join Date: Nov 2004
Originally Posted by David_R
REPLACE(message,'www.olddomain.com','www.newdomain.com')
only that line needs to be changed.

this: "www.olddomain.com" is what u are looking for in the database
and this: "www.newdomain.com" is what being replaced....

change those to whatever u need.
Reply With Quote
  #6  
Old 09 Mar 2005, 18:09
David_R David_R is offline
 
Join Date: Mar 2005
Real name: David RutherFord
will this work properly for hyperlinks too ?
Reply With Quote
  #7  
Old 09 Mar 2005, 19:29
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
It will run on any text.
__________________
Marco van Herwaarden
Ex vBulletin.org Coordinator
Reply With Quote
  #8  
Old 03 Apr 2005, 05:57
David_R David_R is offline
 
Join Date: Mar 2005
Real name: David RutherFord
Thumbs up

Originally Posted by Brad.loo
Run this SQL query:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


For pm's this SQL query:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Note that query is very intensive, you should back-up your db before using it. It may very well screw up a lot of your posts/pms/entire database.

Remember to re-build the postcache if you use it, or the changes will not apper right away.
Posts and PMs Changed properly Thanks
Can you also list some more queries to change Signatures too

Changing homepage set under profile, and text content in the signatures

Last edited by David_R; 03 Apr 2005 at 05:59.
Reply With Quote
  #9  
Old 03 Apr 2005, 11:57
Guy G Guy G is offline
 
Join Date: Nov 2004
Signatures

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Homepage

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #10  
Old 03 Apr 2005, 20:28
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
wouldnt it be easier to use vb's replace feature.
Reply With Quote
  #11  
Old 07 Dec 2011, 13:59
santamia santamia is offline
 
Join Date: Dec 2007
I change domain for my website now is www.mamicamea.ro/forum/ old domain was www.sarcina-nasterea.ro/
For last version of vbulletin and mysql with Apache/2.2.21 is same code?
Reply With Quote
  #12  
Old 30 Mar 2012, 10:45
Scyther's Avatar
Scyther Scyther is offline
 
Join Date: Jul 2009
Real name: Deepak
Originally Posted by Reeve of shinra View Post
wouldnt it be easier to use vb's replace feature.
what is this vb replace feature?
how to do it?
Reply With Quote
  #13  
Old 02 Apr 2012, 10:57
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Real name: Simon
Originally Posted by Scyther View Post
what is this vb replace feature?
how to do it?
It's for find and replace in vBulletin templates found in admincp here http://www.YOURSITE.com/forum/adminc....php?do=search
__________________
Kind regards,
Simon Microsoft Office Help
My Mods: Find my modifications here
Please do not pm me for support unless i have invited you to!
Reply With Quote
  #14  
Old 03 Apr 2012, 06:40
Scyther's Avatar
Scyther Scyther is offline
 
Join Date: Jul 2009
Real name: Deepak
I am facing similar situation here.

I am trying to add my old forum's database to the new forum, but when i add it and try to access the site, it redirects to the old domain and not the new one!!!


How do i fix this?

The old domain is not with me anymore, hence i can't update it via Admincp as well..!
Reply With Quote
  #15  
Old 03 Apr 2012, 13:28
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Real name: Simon
Copy the database over and change all instances of the domain name (2 places i think). Try the 'setting' table (bbburl varname) and search for bburl in the 'datastore' table also and change the first URL after that in the text.
__________________
Kind regards,
Simon Microsoft Office Help
My Mods: Find my modifications here
Please do not pm me for support unless i have invited you to!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 17:55.

Layout Options | Width: Wide Color: