PHP Bulletin Board Home
News About Home
Features of phpBB Test drive phpBB Downloads Support for phpBB The phpBB Community Styles for customising phpBB 3rd party modifications to phpBB

Support Home | Knowledge Base Home | Submit Article | Search Articles | Browse Articles
 Transfer hosts/backup and restore database 
Description: How to move your boards to a different host, keeping the data intact.
Author: Black Fluffy Lion
Date: Tue Oct 29, 2002 4:07 pm
Type: HowTo
Keywords: backups, database, mysql, forum, move, transferring, different, other, host, server
Category: Installing/upgrading/converting
Since lots of people seem to be asking this, I've decided to make up a handy dandy idiot's guide on moving your fora to a different host.

I backed up everything on the FTP but when I uploaded it to my new host all the information had gone! How comes?

The files on your FTP, the ones you downloaded from sourceforge do not contain the data of your fora. The data is stored in (suprise, suprise) the database. That is where all your information (post text, members, smiley information etc.) is. If you don't want to lose that information you'll have to back up the database, backing up the files will do nothing.

So how do I back up the database?

If you have admin access to the site there's a nice little feature called backup database which (suprise, suprise) backs up the database! Click on it (remember, this is the idiot's guide, sorry if it sounds obvious) and back up the database with structure and data. Compress it if you wish, but only if your new server will be able to handle a gzipped file.

That's all very well and good but I don't have admin access. How do I back it up now?

You may have a nice little program called phpMyAdmin installed. This can also backup your database. To do so click on your username at the top of the left frame. Scroll down the right frame a bit until you reach 'View dump (schema) of database'. Again, you want to backup both structure and data. When you have selected the settings you want click 'Go' and you will download the dump file of your database. Easy huh??

I can't use the admin panel database backup option and I don't have phpMyAdmin. Can I still backup?

Yes, but only if you have telnet access to your server. From the command-prompt, do the following:

>mysqldump -u USERNAME -p DATABASE_NAME >backup.sql

USERNAME is the mysql username for your database
DATABASE_NAME is the mysql database name of the phpBB database

Right, I've backed up my database. Now how do I restore all the information to my new host?

Install phpBB2 at your new host and go to the admin panel and select 'Restore database'. Find the file on your computer and upload it!

I don't have access to the admin panel! How can I restore it?

If you don't have access to the admin panel then you can do it by phpMyAdmin as well. Click your username on the top left and scroll down the right frame until you reach 'Or Location of the textfile'. Click 'browse' and find the file. Click 'Go' and watch your database being uploaded! Note: phpMyAdmin cannot always handle uploading large databases.

I can't restore it through the admin panel and don't have phpMyAdmin either. How do I restore the database?

Copy the backup.sql file to the new server location and import it with:

>mysql -u USERNAME -p DATABASE_NAME < backup.sql

USERNAME is the mysql username for your database
DATABASE_NAME is the mysql database name of the phpBB database

Is that all?

Almost...chances are your information has changed since your last host so make sure you update config.php to reflect these changes.

Now, is that all?

Yes.

hope that was very easy to understand and that this question will not arise again...

Username: Password:
News | Features | Demo | Downloads | Support | Community | Styles | Mods | Links | Merchandise | About | Home
 © Copyright 2002 The phpBB Group.