How to change the date of Blog posts?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Samhayne
    New Member
    • Mar 2010
    • 5
    • 4.0.0

    [Blog] How to change the date of Blog posts?

    Is there a way to change the post dates to blog articles? I also have a number of old blog articles that I'm porting over from an old web site to our new vBulletin site. I want to re-enter them by hand, but change the date to be the original date, not today's date.

    I can't seem to find any way to edit blog post dates.

    Thanks in advance for any assistance you can provide.
  • ENF
    Senior Member
    • Apr 2002
    • 2677
    • 3.8.11

    #2
    Originally posted by Samhayne
    Is there a way to change the post dates to blog articles? I also have a number of old blog articles that I'm porting over from an old web site to our new vBulletin site. I want to re-enter them by hand, but change the date to be the original date, not today's date.

    I can't seem to find any way to edit blog post dates.

    Thanks in advance for any assistance you can provide.
    Why not just copy and paste the blog entry and post it as a new entry in the vBulletin Blog?
    To be updated...

    Comment

    • Samhayne
      New Member
      • Mar 2010
      • 5
      • 4.0.0

      #3
      Originally posted by ENF
      Why not just copy and paste the blog entry and post it as a new entry in the vBulletin Blog?
      That is exactly what I'm doing. Copying the old blog from the old site over to the new blog at the new site. This way we'd preserve our blog's history.

      The thing is, I have oh, 2 years worth of blog posts (about 1 a month, so for fun lets say 24 blog posts). However, when I post the oldest of the 24 to the new blog, it's this old information that, when you read it, you can tell is dated - but it has today's date and time on it. I'd like for the blog to read like the old one does and preserve the history of the blog over on the new site.

      I get the sinking feeling that I'll have to go into the database and poke the dates - but I'd really like to not have to go that route. It is so easy to edit article dates in the CMS - why not blog post dates as well?

      Comment

      • ENF
        Senior Member
        • Apr 2002
        • 2677
        • 3.8.11

        #4
        Oh, I see what you are saying. I somewhat reversed in my mind what you actually wrote. I do apologize!

        Now, for your question. No, there is no way to edit the date of the blog that I am aware of, from inside the software.

        However! There is way to do so via the database. Do you understand SQL, and how to run queries against your database?

        I can give you the instructions on how to edit the dates for each blog entry via queries, but let me know your feelings on doing it.
        To be updated...

        Comment

        • Samhayne
          New Member
          • Mar 2010
          • 5
          • 4.0.0

          #5
          Sure. I've done some minor SQL stuff in the past, edited existing queries and the like. If you have step by step stuff I'd really appreciate the instructions.

          Thank you so much for your assistance!

          Comment

          • ENF
            Senior Member
            • Apr 2002
            • 2677
            • 3.8.11

            #6
            The key pieces of information you need:

            1) Be able to execute queries against your database. (i.e. have your user id number included in the config.php, in the query section) OR use a tool such as phpmyadmin.
            2) Know your database name and whatever table prefix you may be using.
            3) The target fields in your databases, from the "blog" table: blogid and dateline

            The basic query should like like this:
            Code:
            UPDATE blog
            SET dateline = '1234567890'
            WHERE blogid = 'XXX'
            The dates in the database are in UNIX format, so you need to first pick the date you want use and then use a UNIX time calculator such as this one: http://www.onlineconversion.com/unix_time.htm

            Example: Inside the database, a sample date looks like this: 1260651740 -- When you run it through the converter, it comes out to: Sat, 12 Dec 2009 21:02:20 GMT. So, you want to do this backwards. Right now, today's date is 3/25/10 10:04 PM, so I'll feed that into the converter and I get: 1269554640

            For your query: Get the blog id from the URL of the actual blog entry, if you've just started, the numbers will be fairly low. Then, pick the date you want to use and convert it to the UNIX time stamp as shown above.

            Example: I have blogid "5" and I want to use December 31, 2009 6:00 AM, UNIX time stamp is now: 1262239200

            The query should then look like this:
            Code:
            UPDATE blog
             SET dateline = '1262239200'
             WHERE blogid = '5'
            After the table is updated,the selected blog should now show the new, desired date.

            Hope this helps and good luck. -- REMEMBER to update the table name with a prefix if you use one, otherwise it will fail. (i.e myprefix_blog)
            Last edited by ENF; Fri 26 Mar '10, 6:58am. Reason: Typographical Error.
            To be updated...

            Comment

            • Samhayne
              New Member
              • Mar 2010
              • 5
              • 4.0.0

              #7
              Awesome instructions! Thank you so much for your help We're just getting all the blog posts over and I plan to start poking the DB today or this weekend. I'll be sure to let you know how it goes. I really appreciate the help!

              Comment

              • ENF
                Senior Member
                • Apr 2002
                • 2677
                • 3.8.11

                #8
                Originally posted by Samhayne
                Awesome instructions! Thank you so much for your help We're just getting all the blog posts over and I plan to start poking the DB today or this weekend. I'll be sure to let you know how it goes. I really appreciate the help!
                Ok. Those instructions should work as described, but I'll check back here off and on this weekend. Good Luck.
                To be updated...

                Comment

                • BrightStar
                  Senior Member
                  • Nov 2008
                  • 126
                  • 4.1.x

                  #9
                  Sorry to dig up the old thread but is it possible to change the date of comments posted? I am in a similar situation as OP but want to copy comments as well. Any chance of doing so?

                  Thanks

                  Comment

                  • ENF
                    Senior Member
                    • Apr 2002
                    • 2677
                    • 3.8.11

                    #10
                    Originally posted by BrightStar
                    Sorry to dig up the old thread but is it possible to change the date of comments posted? I am in a similar situation as OP but want to copy comments as well. Any chance of doing so?

                    Thanks
                    Same process as you see in post #6 above... but this is the modified code for comments:

                    Code:
                    UPDATE post
                    SET dateline = 'XXXXXXXXX' 
                    WHERE postid = 'X'
                    Replace dateline XXXXXXXX with the actual date code as described in post #6.
                    Replace postid "X" with the ID number of the comment. (All comments are stored in the post table, hence 'update post')

                    I tested this on a vb4.1.11 system, works as I explained.

                    Please use caution when executing queries against your database.
                    To be updated...

                    Comment

                    • BrightStar
                      Senior Member
                      • Nov 2008
                      • 126
                      • 4.1.x

                      #11
                      Thanks ENF.

                      I get this error when trying to run this query.

                      An error occurred while attempting to execute your query. The following information was returned. error number: 1146
                      error desc: Table 'forum_vb.post' doesn't exist

                      Comment

                      • ENF
                        Senior Member
                        • Apr 2002
                        • 2677
                        • 3.8.11

                        #12
                        Originally posted by BrightStar
                        Thanks ENF.

                        I get this error when trying to run this query.
                        Check your database name and prefixes. The above query is a raw query, assuming you would adjust it for your database and any table prefixes you may have.

                        If you don't have a post table, you have bigger problems!
                        To be updated...

                        Comment

                        Related Topics

                        Collapse

                        Working...