Restoring a large database with FTP |
Description: easy 'hack' for restoring a large database in just a few steps. |
Author: randallschleufer |
Date: Fri Nov 12, 2004 10:50 pm |
Type: HowTo |
Keywords: backup, restore, large, big, database, fix, upload, ftp, admin, panel, mysql |
Category: Administrating |
|
I've found several solutions for restoring large DBs, but none as simple as this "emergency hack". As long as you have FTP access to the forum, you can probably use this method.
Using the FTP client of your choice, upload your backup.sql file to phpBB/admin/, where backup.sql is the name of your backup file and phpBB is the name of your forum root directory.
It could probably take a while to upload, so go get a cup of coffee or check your email... or something.
When the file is finished uploading, you need to modify ONE phpBB file. Notice phpBB/admin/admin_db_utilities.php is in THE SAME directory that you just uploaded your backup.sql.
In phpBB/admin/admin_db_utilities.php find the code snippet:
Code: |
else
{
$sql_query = fread(fopen($backup_file_tmpname, 'r'), filesize($backup_file_tmpname));
}
|
Now we can force phpBB to read our file by replacing the above code with this code ("backup.sql" is the name of your backup file, and the quotes are required):
Code: |
else
{
$sql_query = fread(fopen("backup.sql",'r'), filesize("backup.sql"));
}
|
Go into your phpBB Admin Control panel, click the Restore Database link.
Type anything you want into the textbox, but don't leave it empty.Click the Start Restore button and your Database will start restoring immediately (no more uploading required). It may take a couple minutes for the process to finish, so go get another cup of coffee. When you get back, it *should* tell you that the DB was properly restored.
Just for security, restore your phpBB/admin/admin_db_utilities.php file to its original state and delete the phpBB/admin/backup.sql file. This will prevent "accidental" restoration (there are no safeguards in place for this method/hack) |
|
|