Announcement

Collapse
No announcement yet.

Is there a find and replace option in Vbulletin

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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


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

      Comment


      • #4
        Check here...
        http://www.vbulletin.com/docs/html/maintenance_query

        or run it in phpmyadmin.
        Lats...

        Comment


        • #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


          • #6
            Originally posted by Andy View Post
            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


            • #7
              Originally posted by Andy View Post
              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


              • #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


                • #9
                  Originally posted by fxm View Post
                  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

                  TalkNewsUK - My vBulletin 5.4.2 Demo - FEATURING "ROUTE BY NODE"!
                  AdminAmmo - My Cloud Demo

                  Comment

                  Working...
                  X