Current time: 04-20-2014, 03:11 AM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Forum Sandbox
06-24-2010, 10:16 AM
Post: #11
RE: Forum Sandbox
Even easier then XD

Quote:Golf and alcohol don't mix, that's why I don't drink and drive!
Video Tutorials: Installing MyBB | Upgrading MyBB
Visit this user's website Find all posts by this user
06-24-2010, 05:01 PM
Post: #12
RE: Forum Sandbox
My forum uses 1.6 Smile So, if you could give that script to me with some instructions (noob in the house! Big Grin) I'd be grateful. Smile

Everyday I go and look at my forum wondering if it survived. Toungue

Common Webmaster Mistakes
OpenNotion - Open-Source Idea Collaboration Software
Visit this user's website Find all posts by this user
06-24-2010, 08:09 PM
Post: #13
RE: Forum Sandbox
Well, its not the simplest script in the world, but I can PM you instrucitons if you like (when i find it on the depths of my PC Big Grin)

Quote:Golf and alcohol don't mix, that's why I don't drink and drive!
Video Tutorials: Installing MyBB | Upgrading MyBB
Visit this user's website Find all posts by this user
06-25-2010, 03:49 AM
Post: #14
RE: Forum Sandbox
Okay, thanks. Big Grin

Common Webmaster Mistakes
OpenNotion - Open-Source Idea Collaboration Software
Visit this user's website Find all posts by this user
06-25-2010, 06:05 AM
Post: #15
RE: Forum Sandbox
(06-24-2010 08:09 PM)Tommyk Wrote:  Well, its not the simplest script in the world, but I can PM you instrucitons if you like (when i find it on the depths of my PC Big Grin)

I want it too. Toungue
Find all posts by this user
06-25-2010, 06:36 AM
Post: #16
RE: Forum Sandbox
Haha! Toungue

Common Webmaster Mistakes
OpenNotion - Open-Source Idea Collaboration Software
Visit this user's website Find all posts by this user
06-27-2010, 05:57 PM (This post was last modified: 06-27-2010 06:03 PM by mark-in-dallas.)
Post: #17
RE: Forum Sandbox
(06-24-2010 05:47 AM)darkly Wrote:  You should work on a script to auto reinstall the forum. Wink

(06-24-2010 06:01 AM)Modv2 Wrote:  I'm terrible at php. Toungue

No php experinece required. I'll give you what you need!

To start with you will need to export a copy of your database as a sql file. If you have cPanel, Plesk or any other Control Panel, go into it and go into phpMyAdmin, click on your myBB database on the left hand side to open the databse, then at the top click on the Export Tab, select all tables and scroll down towards the bottom and check the Save As File checkbox, name it now go over to the right and click Go, select where you want to download the file to and name it "db_refresh.sql". There's your database backup!

Now you'll need to create a file called db_refresh.php and copy and paste the code below into it, changing the database connection information to your database username, database name, pssword and editing the $site line for your URL:

Code:
<?php

    $db_host = 'localhost (Or THE DATABASE ACCESS IF DIFFERENT)';
    $db_user= 'YOUR USERNAME';
    $db_pass = 'YOUR PASSWORD';
    $db_name = 'YOUR DATABASE NAME';
    
    $site = 'http:/YOUR WEBSITE ADDRESS/';

    $dbh=mysql_connect ($db_host, $db_user, $db_pass) or die ('I cannot connect to the database because: ' . mysql_error());
    mysql_select_db ($db_name);

    $sqlfile = "db_refresh.sql";
    $fp = fopen($sqlfile, "rb");
    $buffer = fread($fp, filesize($sqlfile));
    fclose($fp);
    $lines = preg_split("/;/", $buffer);

    foreach ($lines as $line_num => $line) {
        echo $line  . "<br>";
        $result = mysql_query ($line)OR die(mysql_error());
    }
?>

Now you'll place the exported sql file and the ds_refresh file somewhere on your server, in the same folder or directory. You can create a new folder if you want too.

And finally, we will setup a cron job to restore the database at whatever interval you want.

Go back into your Control Panel and find Cron Jobs, open it up and create the Cron Job as follows. In the text box for the Command enter this

php -q /home/YOUR DOMAIN USERNAME/public_html/FOLDER YOU PLACED THE FILES IN/db_refresh.php

Now just select the interval you want to restore our sandbox site and wholla, the forum is back to it's original state on every run of the cron job.

You've given myBB members something great to test plugins and code on, so I'm giving you an easy way to restore it to back to the original. Big Grin
Visit this user's website Find all posts by this user
06-27-2010, 06:28 PM
Post: #18
RE: Forum Sandbox
Wow, thanks! Big Grin I'll be sure to insert it once I get time.

Common Webmaster Mistakes
OpenNotion - Open-Source Idea Collaboration Software
Visit this user's website Find all posts by this user
06-27-2010, 07:00 PM
Post: #19
RE: Forum Sandbox
Where is it? >.>

[Image: classic-76561198040401974.png]
Play With Me =] Steam- shawnilizer1 | Xfire- shawnilizer | Origin- ShawniX-
Visit this user's website Find all posts by this user
06-27-2010, 07:24 PM
Post: #20
RE: Forum Sandbox
Where is what?

Common Webmaster Mistakes
OpenNotion - Open-Source Idea Collaboration Software
Visit this user's website Find all posts by this user


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication