Database Restore


Restoring a backup with phpMyAdmin

  1. To restore a database, you click the SQL tab (on newer versions of phpMyAdmin there is an "Import" tab).
  2. On the "SQL"-page , unclick the show query here again.
  3. Browse to your backup of the database.
  4. Click "Go".

Restoring a backup with SSH/Telnet

  1. Log into your SSH/Telnet account.
  2. Have your .SQL dump/backup ready, extracted from the .gz backup that you made via the Admin CP or from phpMyAdmin.
  3. You may have to drop all tables from the MyBB database first, because the Admin CP backup SQL doesn't include DROP TABLE statements. You can do that with the following command line. Type your MyBB database password when prompted.user=YOUR_MYBB_DB_USER; db=YOUR_MYBB_DBNAME; mysql -u $user -p -BNe "show tables" $db | tr '\n' ',' | sed -e 's/,$//' | awk '{print "SET FOREIGN_KEY_CHECKS = 0;DROP TABLE IF EXISTS " $1 ";SET FOREIGN_KEY_CHECKS = 1;"}' | mysql -u $user -p $db.
  4. Run mysql -u YOUR_MYBB_DB_USER -p YOUR_MYBB_DBNAME < /PATH/TO/DUMP.SQL

Other Methods

If you don't have SSH/Telnet access, you can download a restoring tool called BigDump. This works well for databases that are large and timeout phpMyAdmin.

This page was last modified on 5 July 2011, at 23:49.