Is there a find and replace option in Vbulletin

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • morny
    Member
    • Jun 2008
    • 34

    Is there a find and replace option in Vbulletin

    Hi,

    Big problesm with our host, we had all our links specified as the IP address while waiting to change from 208.xx.xx.xx to our new website address but after a big messup theyre in the process of moving us and the old 208.xx.xx.xx will become inactive so theres thousands of links that will be dead on the forum so is it possible to run a find and replace command on my files to change all the 208.xx.xx.xx to www.mywebsite.com

    Really need to get this resolved ASAP as the changeover will happen soon
  • Lats
    Senior Member
    • Mar 2002
    • 3671

    #2
    You need to run a query...
    Code:
    UPDATE 
      post 
    SET 
      pagetext = replace(pagetext,'oldip', 'newip') 
    WHERE
      pagetext LIKE '%oldip%'
    Change oldip & newip with your details.
    Lats...

    Comment

    • morny
      Member
      • Jun 2008
      • 34

      #3
      Thats absolutely super, one question, where do i go to execute that query?

      Comment

      • Lats
        Senior Member
        • Mar 2002
        • 3671

        #4
        Check here...


        or run it in phpmyadmin.
        Lats...

        Comment

        • Andy
          Senior Member
          • Jan 2002
          • 5886
          • 4.1.x

          #5
          Hi Lats,

          I've really enjoyed learning from your query examples.

          Question, I have always just used this query to replace text in posts.

          UPDATE post SET pagetext = REPLACE(pagetext, 'old name', 'new name')

          your example is very similar but I assume the last part is not needed.

          Comment

          • jmurrayhead
            Senior Member
            • Sep 2006
            • 1642

            #6
            Originally posted by Andy
            Hi Lats,

            I've really enjoyed learning from your query examples.

            Question, I have always just used this query to replace text in posts.

            UPDATE post SET pagetext = REPLACE(pagetext, 'old name', 'new name')

            your example is very similar but I assume the last part is not needed.
            yes it's needed...

            You're using the Replace function. In the example above it's taking three parameters: the column, the old IP and the new IP.

            What it does: searches for the old IP in the specified column and replaces it with the new IP.

            EDIT::::

            Sorry, thought you were talking about the last part of the Replace function, not the 'WHERE clause' of the query.
            No...No...Meester vBulletin, he no work right.

            Comment

            • Lats
              Senior Member
              • Mar 2002
              • 3671

              #7
              Originally posted by Andy
              your example is very similar but I assume the last part is not needed.
              In this case technically true, as the db still has to do a table scan on the post table, but I normally always put in a WHERE clause for good practise.
              Lats...

              Comment

              • fxm
                New Member
                • Feb 2009
                • 29
                • 3.8.x

                #8
                How would I perform a find / replace query for a specific forum id?

                I understand the 1st part would be:

                UPDATE post SET pagetext = REPLACE(pagetext, 'old text', 'new text')

                But not too sure on the 2nd part. I'm guessing something like this?

                WHERE forumid = xx

                Your help would be appreciated, thanks.

                Comment

                • Mark.B
                  vBulletin Support
                  • Feb 2004
                  • 24286
                  • 6.0.X

                  #9
                  Originally posted by fxm
                  How would I perform a find / replace query for a specific forum id?

                  I understand the 1st part would be:

                  UPDATE post SET pagetext = REPLACE(pagetext, 'old text', 'new text')

                  But not too sure on the 2nd part. I'm guessing something like this?

                  WHERE forumid = xx

                  Your help would be appreciated, thanks.
                  No that won't work because the post table has no forumid. The forumid is in the thread table so you'd need to join that first.

                  Probably best to start a new thread for this, as this thread is nine years old.
                  MARK.B
                  vBulletin Support
                  ------------
                  My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
                  My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

                  Comment

                  widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                  Working...