1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Inserting threads and posts directly to the database

Discussion in 'Troubleshooting and Problems' started by suineg, Aug 16, 2016.

  1. suineg

    suineg Member

    I inserted in the database a new thread directly for an empty forum, and using the database I added the posts, When i navigated to that forum i see the thread and posts, but the homepage shows no messages in this forum. Is there other tables I need to update?

    This is because we are pulling posts from an old forum of ours we don't have admin access to in order to make a dump for importing.
  2. Chris D

    Chris D XenForo Developer Staff Member

    There's quite a bit of cached data; the last poster details of a thread, the first post ID and the last post ID, and the counts of how many threads are in a forum, and how many messages, the position of each post, etc.

    For these reasons it's not at all recommended to do what you're doing.

    That said, the bulk of this information can be rebuilt in the Admin CP > Tools > Rebuild Caches page. You can rebuild forums, threads, post positions and counters etc. so these will need doing to get some of these caches rebuild.

    That said, there's a chance that not everything is going to be rebuilt like this so this may require further effort to resolve but due to the nature of what you're doing it's not something we can recommend or support.
  3. suineg

    suineg Member

    Yeah I ran through all the rebuilds thinking that would do it.

    I get that you wouldn't support or recommend something like this. Is there another method you would recommend for a scraped forum to xenforo conversion?

    Negotiations to buy our own data did not go well with an astronomical price being the asking. We decided to start over and then scrape and get some of our smarter guys on it. They almost have it just that final step is missing :D
  4. Chris D

    Chris D XenForo Developer Staff Member

    I won't ask... that sounds like a long story :)

    The best thing to do would be to use PHP code to insert the records and use our DataWriter framework.

    The DataWriter system handles all of the life cycle stuff that needs to be triggered automatically. There will obviously be a learning curve here, but it would handle all of the rebuilds automatically.
  5. suineg

    suineg Member

    We will look into that then, thank you.

    Suffice to say it is a long story and you shouldn't buy a forum based on page hits and think they will stay just because you bought it. Place is a ghost town now!
  6. suineg

    suineg Member

    I know you probably cringe to hear this @Chris D but we successfully imported 1.5M+ posts directly to the database and the database doesn't look too worse for the wear. The forum is running smooth and you wouldn't be able to tell they weren't created natively.
    Chris D likes this.

Share This Page