MyBB Community Forums

Full Version: Pulling a Thread from Backup
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was wondering if there is someway to get a thread restored from backup file. I have made backups each time I do a version update. A number of older, inactive threads have since been deleted. I was wondering if there was someway to pull single thread from the old backups?

An old, inactive user has returned and unfortunately his thread was one of the ones that was deleted. I was hoping for a way to restore his old thread without having to do a full restore. I don't want to lose the new threads and posts for an old one. If I can't it's no big deal but if I can that would be nice. It sounds like they where almost finished before one of them went on sabbatical.
If you have a SQL backup it's easy Smile

1. Make a backup or your MYBB root directory (all files)
2. Upload it to your localhost server
3. Import your SQL backup to your localhost PHPmyadmin
4. Connect database to your MYBB forum script by modifying: config.php and settings.php
That's how you do a full restore, Marcus. The OP is trying to avoid that.

It isn't an easy process, but what you can do is import your backup into a new database in phpmyadmin and search for the thread you want. Once you've found it, use the tid to search for the posts. I would also check for thread previews and thread ratings.

Each time you find the results you want, export the results. You should then be able to import just those files into your live database. It shouldn't overwrite any existing data in the database.
@jshort baby I said on localhost then you can do whatever you want with it as contains the data you are looking for.
You can do something like this if you have the old thread and old post table named something else
INSERT INTO mybb_threads (SELECT * FROM mybb_oldthreads WHERE tid=x);
INSERT INTO mybb_posts (SELECT * FROM mybb_oldposts WHERE tid=x);

Replace x with the tid of the thread.

After doing these, you will want to rebuild forum counters, rebuild stats, and user post counts. These are all in the ACP under the Tools->& Maintenance.
Marcus, I know you said localhost, but you didn't actually answer OP's question as to how to get the specific thread they are looking for once they have the database. Also, calling people you don't know baby...that's just kind of weird.

Negima, I suggest using dragonexpert's queries. It's probably the simplest and easiest way to get the data you need. Good luck!
(2014-07-27, 06:08 PM)jshort Wrote: [ -> ]Marcus, I know you said localhost, but you didn't actually answer OP's question as to how to get the specific thread they are looking for once they have the database. Also, calling people you don't know baby...that's just kind of weird.

Negima, I suggest using dragonexpert's queries. It's probably the simplest and easiest way to get the data you need. Good luck!

Marcus appears to be on a very different planet to you and the op ... I don't know if the op will be able to import the old tables into his current database.
@Marcus not everyone bothers or can install a server on their local machine when replying always assume that a local server does not exist.
(2014-07-27, 02:46 PM)dragonexpert Wrote: [ -> ]You can do something like this if you have the old thread and old post table named something else
INSERT INTO mybb_threads (SELECT * FROM mybb_oldthreads WHERE tid=x);
INSERT INTO mybb_posts (SELECT * FROM mybb_oldposts WHERE tid=x);

Replace x with the tid of the thread.

After doing these, you will want to rebuild forum counters, rebuild stats, and user post counts. These are all in the ACP under the Tools->& Maintenance.

I have the backups on my computer and the site is with my host. I was thinking I would have to up load it somewhere with my host C Panel. That said I don't know that the name of the thread is at the moment, only who made it and the other user who posted. A lot of threads where deleted as no one had posted in the for over a year, often longer.

Now that I took another look at the backup system of my host I have been making backups with "Download a Home Directory Backup." There is also "Download a MySQL Database Backup" below it. If I needed the SQL backup I maybe out of luck.