1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help with the copy table queries

Discussion in 'Databases' started by karabaja2, Nov 11, 2014.

  1. #1
    Hi there to you all!

    Today one of mine SuperModerator deleted more than 10,000 of its posts. The problem is that I do not have a recent backup but I have a backup of 4th October this year.
    So I've been told to do this:

    "Copy the post and thread tables from the old backup, add them to the database as post2 and thread2 tables for example.

    Then you need a query to copy the entire post from the post2 table to the post table where the postid exists in the post2 table but not in the regular post table.
    Repeat for the thread / thread 2 table.
    Then clear the cache, rebuild the forum and thread counters.
    That should work"

    SEMrush
    But I do not know how to perform these queries.
    Would someone be kind enough to write them and save me, please.
     
    karabaja2, Nov 11, 2014 IP
    SEMrush
  2. bl4ckwolf

    bl4ckwolf Active Member

    Messages:
    216
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    Hi,

    I don't know the table structure, but assuming that you can scope what to insert it could be as simple as :
    INSERT INTO post select * from post2 where....
    INSERT INTO Thread select * from Thread2 where...

    If Post and Thread are empty, forget the where clause. If not, you will need to scope the select because you will have duplicates entries
     
    bl4ckwolf, Nov 12, 2014 IP