MyBB Documentation

Database Restore

The 1.6 Documentation is no longer maintained and some information may be outdated.

The MyBB 1.6 series reached end of life on October 1, 2015.

This means there will be no more security or maintenance releases for these series and forums running these versions of MyBB may be at risk of unfixed security issues. All administrators are strongly encouraged to upgrade their forums to the latest release of MyBB as soon as possible.

  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".
  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

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.

Tutorials
Database Backup - Database Restore - How to CHMOD - User-submitted tutorials on the Community Forums

Edit this page on GitHub