Restore a backed up database, import a database

Home Forums BulletProof Security Pro Restore a backed up database, import a database

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #18793
    Matt Zarba
    Participant

    I backup my database once a day using BPS pro backup tool . How do I restore a backup?

    #18795
    AITpro Admin
    Keymaster

    Log into your web host control panel, look for phpMyAdmin (will either be an icon or could be listed under Databases) and then follow the WordPress database restore steps below.

    http://codex.wordpress.org/Restoring_Your_Database_From_Backup

    Restore Process

    Using phpMyAdmin, follow the steps below to restore a MySQL database.

    1. Login to phpMyAdmin.
    2. Click “Databases” and select the database that you will be importing your data into.
    3. You will then see either a list of tables already inside that database or a screen that says no tables exist. This depends on your setup.
    4. Across the top of the screen will be a row of tabs. Click the Import tab.
    5. On the next screen will be a location of text file box, and next to that a button named Browse.
    6. Click Browse. Locate the backup file stored on your computer.
    7. Make sure SQL is selected in the Format drop-down menu.
    8. Click the Go button.

    Now grab a coffee. This bit takes a while. Eventually you will see a success screen.

    #20594
    Terry Thornton
    Participant

    Trouble in test restore of BPS file to empty database. Followed the instructions above and received the following error from phpMyAdmin:

    Error
    SQL query:
    INSERT INTO  wp_spider_faq_faq ( id, title, standcat, category, standcategory, theme, show_searchform, expand, numbertext, LIKE , hits, DATE, user )
    VALUES ( 2,  'General Information', 0,  ',2,',  ',1,',  '', 1, 0, 1, 1, 1, 1, 1 );
    MySQL said: Documentation
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like, hits, date, user )
    VALUES ( 2, 'General Information', 0, ',2,', ',1,', ''' at line 1
    #20603
    AITpro Admin
    Keymaster

    I assume that the problem is with the wp_spider_faq_faq database table itself and not your entire database or with other database tables. To confirm that the problem is only with the wp_spider_faq_faq database table do these troubleshooting steps:

    1. Make another backup of your database and do NOT include the wp_spider_faq_faq database table in that backup.
    2. Import your database.
    3. If the error does not occur again then contact the wp spider plugin folks to have them correct their code/syntax.

    #20732
    Terry Thornton
    Participant

    Is it possible to do a partial restore from the original backup? Can i do all of the tables except wp_spider_faq_faq database some how? this has become more urgent because a plug-in update has messed up my production site and i want to restore it from the BPS backup I made early today. I am afraid to do a full restore and have it fail on that table and kill the site entirely.

    #20734
    AITpro Admin
    Keymaster

    Yes.  This is the way that I would do that manually by editing the .sql backup file directly.

    1. Download and install this application on your computer:  Notepad++:  http://notepad-plus-plus.org/download/v6.7.4.html
    2. Extract/unzip your DB backup zip file on your computer.
    3. Open the .sql extracted/unzipped DB backup file with Notepad++
    4. Edit the .sql file and remove/delete the section of code in the .sql file for the spider db table.
    5. Save your edits to the .sql db backup file.
    6. Do the database import.

    Example db table deletion/removal (using a random example db table name): Delete the entire DB backup table code starting from DROP TABLE IF EXISTS to the end of that specific DB table’s section of code ONLY.

    DROP TABLE IF EXISTS wp_TABLE_STATISTICS;
    /*!40101 SET @saved_cs_client = @@character_set_client */;
    /*!40101 SET character_set_client = 'utf8' */;
    CREATE TABLE wp_TABLE_STATISTICS (
    name enum('hits','hits_day','hits_day_nobots','hits_month','hits_month_nobots','hits_nobots','hits_week','hits_week_nobots','hits_year','hits_year_nobots','post_count','raw_count','user_count','visits','visits_day','visits_day_nobots','visits_month','visits_month_nobots','visits_nobots','visits_week','visits_week_nobots','visits_year','visits_year_nobots') NOT NULL,
    type tinyint(3) unsigned NOT NULL default '0',
    val1 int(11) unsigned NOT NULL default '0',
    val2 int(11) unsigned NOT NULL default '0',
    val3 int(11) unsigned NOT NULL default '0',
    KEY type (type,val1,val2),
    KEY name (name,type,val1,val2,val3`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    /*!40101 SET character_set_client = @saved_cs_client */;
    --
    -- Dumping data for table wp_TABLE_STATISTICS
    --
    
    /*!40000 ALTER TABLE wp_TABLE_STATISTICS DISABLE KEYS */;
    INSERT INTO wp_TABLE_STATISTICS ( name, type, val1, val2, val3 )
    VALUES ( 'hits', 6, 0, 0, 72345 );
    ...
    ...
    ...
    ...
    INSERT INTO wp_TABLE_STATISTICS ( name, type, val1, val2, val3 )
    VALUES ( 'visits_year_nobots', 26, 2010, 0, 14006 );
    /*!40000 ALTER TABLE wp_TABLE_STATISTICS ENABLE KEYS */;
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.