- To restore a database, you click the SQL tab (on newer versions of phpMyAdmin there is an "Import" tab).
- On the "SQL"-page , unclick the show query here again.
- Browse to your backup of the database.
- Click "Go".
- Log into your SSH/Telnet account.
- Have your .SQL dump/backup ready, extracted from the .gz backup that you made via the Admin CP or from phpMyAdmin.
- 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
. - 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.
Database Backup - Database Restore - How to CHMOD - User-submitted tutorials on the Community Forums |