MyBB Community Forums

Full Version: Template Backup?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I screwed up one of my postbit templates. How do get the "postbit" template backup, from one of my site backups?
do you have any plugins affecting postbit ?
you can simply revert the postbit templates AND deactivate & reactivate any plugins which affect postbit
(2015-01-05, 07:06 AM).m. Wrote: [ -> ]do you have any plugins affecting postbit ?
you can simply revert the postbit templates AND deactivate & reactivate any plugins which affect postbit

Revert? What will reverting do? Will that revert the last change?
^ reverting changes template's code to original version of the template
Why would I want the original template?

I need to revert to the backup I saved less than 24 hours ago, because the "postbit" template was heavily modified, and I accidentally screwed it up.

Well, I guess I'll just have to restore the entire database backup.
oh! okay.
at forum admin panel hover mouse pointer on the templates set for which you need to get the backup content
browser status bar provides sid of the templates set
eg. forumurl/admin/index.php?module=style-templates&sid=X => sid is X

based on that sid we have to get the required template content.
can you import the database backup into a new empty database at web server / local host server (eg. XAMPP)
or do you have to get the template content by using a text editor (eg. notepad++) ?
I would prefer if I could get the template code as a text file, to open with Notepad++.

Nevertheless, I couldn't wait any longer because it was a huge screw up in the Postbit template and I was panicked, so I just restored the entire Database from the backup I made less than 24 hours ago.

Though I still would like to know if I can restore templates using a text editor (Notepad++), because restoring an entire database is not feasible when it will be in the hundreds of MB (right now it is 3MB).
from plain SQL text file, you have to find required template content similar to below
INSERT INTO `mybb_templates` (`tid`, `title`, `template`, `sid`, `version`, `status`, `dateline`) VALUES (.................................................................)

VALUES consist of comma separated values for the fields
tid => template ID (integer - serial number)
title => template name (eg. postbit, postbit_classic)
template => code in the template
sid => template set id (see this thread)
version => version number (eg. 1800)
status => (I've no idea about this field)
dateline => last saved date

however for the themes it would be better to export the theme with templates for easy revival
Excellent advice ^
Always import your theme before you go for editing. Its the best solution. In case you mess up (Like you did) you can just open that XML file with Notepad ++ and then copy that whole template (Which you messed up), use it in ACP and it will be back to its earlier position.

Also it will help you if you need any piece of code to be copied and you want to use it in new editing...