Community management insight at

Bookmark and Share

Move Your phpBB to Another Server

Move Your phpBB to Another Server

Postby FB-ke » June 28th 2003, 12:38 pm

Say you are tired of your host ripping you off or you simply want a copy of your phpBB running offline for testing purposes. Where do you begin?

This tutorial will try to be as thorough as possible in the process of moving everything flawlessly and without losing any data/information.

Where do we start?

Good question. Well, we must have both the files and the database transferred.

The files, that’s no problem. Just change a few things in config.php and you’re done.

The database, however, can be a little tricky. As you all know, phpBB comes with a backup-restore system by default. But it does not include all tables. I don't really like that and others that have lots of hacks and tweaks installed won’t either.

So, we just go for phpMyAdmin. It will make it so much easier for you, trust me. First, you will need to install it on both servers. If so, learn how to install phpMyAdmin in this tutorial by Acid.

However, you should check if your new server doesn't have phpMyAdmin installed already. Maybe your old one has it also and then you don’t have to install it on either of course.

Okay, I trust that you are now setup with phpMyAdmin. So let’s get started.

First, the database. Go to phpMyAdmin on your old server. In the right frame, select "Export." If you can’t see that, click on the database name in the left frame first. The right frame will change and then you should be able to see it.

You will now get a screen with quite a few options. Select the options listed below for the least amount of incompatibility:
  • Structure
    • Add DROP TABLE
    • Add AUTO_INCREMENT value
  • Data
    • Complete inserts
    • Extended inserts
  • Export Type: INSERT
  • Save as file (with newer versions you can also choose a name, whatever you like).

Last but not least, you need to select the source of the data. On the left of this page, in the Export colum, is a menu list. If you clicked "Export" in the original right frame earlier, this list contains the names of databases on the server. Just click on the database for your forum. If "Export" wasn't shown in the original frame and you had to click on the database name to bring it up, the menu list contains the names of the tables in your forum database. In this case, click "Select All" to highlight all the tables in the menu list. Without that, your file might not contain all of the data that you need. You may also want to gZip or (b)Zip your file, but if you haven't got a clue what it does, don't do it. When you click the "Go" button, your browser should initiate the download. Be aware that it may take a while depending on the size of your database.

OK, you now have a copy of your database on your computer. Let's port the database to the new server.

Just open phpMyAdmin on your new server and go to the SQL window. Again, in the right frame at the top; if you don't see it, click the database name in the left frame first.

You will see a text area there, but that's not what we need. Underneath that, is an input field with the button "Browse..." next to it. Click that and browse to the file you just created from the old server's database. If you Zipped/gZipped it you may have to let phpMyAdmin know that by selecting the appropriate option.

Then click the "Go" button again. Your browser will make all kinds of weird noises for the next couple of minutes probably and I suggest you do not stop the importing process. Or you will just have to start again. When it's done, take care that you do not get an error message (shown at the top).

Your database is now imported successfully. But, we're not done with phpMyAdmin after that. We still have to edit some things. Normally, after the import, you will come back to the same window (SQL). There, put the following SQL queries in the textarea:
UPDATE phpbb_config SET config_value = 'domain_name_here' WHERE config_name = 'cookie_domain';
UPDATE phpbb_config SET config_value = 'domain_name_here' WHERE config_name = 'server_name';
UPDATE phpbb_config SET config_value = 'path_to_phpBB' WHERE config_name = 'cookie_path';
UPDATE phpbb_config SET config_value = 'domain_name_here' WHERE config_name = 'script_path';


Just replace the blue text with the appropriate values. Watch out with the cookie domain and server name. You cannot include http:// or it will not work.

If you have a different table prefix (the standard is 'phpbb_'), you may have to change that in the commands above.

If you have verified that all info is filled in correctly, hit the "Go" button again. It will update a few configuration settings.

That was it for phpMyAdmin. You can now consider your database ready to go. All you need to do now, is upload your phpBB files to the new server. So, just download them to your computer. When done, before uploading, you will have to do one little thing. Edit config.php.
This file contains information to connect to the database and since you're moving to another server, you probably have new connection information.
Open the file in a plain text editor and change the values $dbhost, $dbname, $dbuser, $dbpasswd to the appropriate ones.

Now just upload everything to your new server. If you have installed hacks like File Attachments, Photo Albums and so forth you may have to check some file permissions. Refer to their installation guides if you are not sure what I'm talking about (look for 'chmod'). If you allow avatar uploads, be sure to chmod the images/avatars directory to 777 as well. Read the tutorials on CHMODing if you need to freshen your memory:

Well, I guess that is that. Try accessing your forum on the new server. It should work. Congratulations!
Posts: 3175
Joined: December 12th 2002, 10:14 pm
Location: Scotland, UK

Return to phpBB 2: Technical Reference

Who is online

Users browsing this forum: No registered users and 0 guests