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
 Moving a database 
Description: Includes detailed instructions on backing up with phpMyAdmin and restoring with bigdump.php. Includes instructions for heavily modded boards.
Author: Marshalrusty
Date: Mon Jan 23, 2006 7:52 pm
Type: HowTo
Keywords: backup,restore,bigdump,bigdump.php,moving
Category: Administrating
In this article I will explain how to move a forum. This will be useful if you are switching hosts or if you just need to move the forum to a different server. I will also explain how to properly backup and restore a database.

Database Backup
    You can use the "Backup Database" option in the administration panel, but I recommend using phpMyAdmin. If phpMyAdmin is not provided by your host, you may wish to install it yourself. It can be downloaded here and installation instructions can be found here.
    In phpMyAdmin, select the database with the phpBB tables and click "Export" on top. Click on the image below for the next step. .
    When you've done that, click "Go" and save the file to your hard drive


Files Backup
    This will come in handy if you ever need to refer back to it. You will also need the config.php file as well as any templates you have installed.
    Using your favorite FTP client, copy the entire phpBB folder to your hard drive. Make a backup of the backup (I recommend you zip it up) so you don't accidentally delete a file


Restore Database
    To do this, I recommend using bigdump.php. It will break up the backup into small pieces to keep the server from overloading. It will also make sure that your connection doesn't time out while uploading the .sql file. Anyway, let's get to it.
    1) On your new server create a folder called 'restore'
    2) Download bigdump.php
    3) Unzip the file and open it in Wordpad
    4) Locate the part below in the file and add your new database's info.
    Code:
    $db_server   = "localhost";
    $db_name     = "";
    $db_username = "";
    $db_password = "";

    4) Save the file and upload it to the 'restore' folder on your server
    5) Into that folder upload your database backup (uncompress it, it should be a .sql file)
    6) Navigate to bigdump.php in your browser. (ex. http://www.yoursite.com/restore/bigdump.php)
    7) You will now see your backup file with "Start Restore" to the right of it. Click that and sit back while the restore is being processed. If all goes well, you will get a confirmation message when the restore is complete. You may now delete the 'restore' folder


Restore Files
    Depending on whether you have MODs installed, this part is different. If you don't have MODs installed/don't want to keep them, you will be uploading fresh copies of the files. If you do wish to keep your MODs, you will be uploading the backup of your files you made before. Note that if you are using an old version of phpBB, I suggest you go with the "No MODs" method and then reinstall your MODs.
    If you don't have MODs installed/are willing to reinstall them
      1) Download a fresh copy of the full package
      2) Unzip the files into a folder (let's call it FolderA)
      3) Take you old config.php file (from your backup) and edit it to reflect the new database. See this article if you need assistance. Copy the config.php file you just made to FolderA (overwriting the one currently there)
      4) Delete the contrib folder from FolderA
      5) Upload the contents of folder A to your server (overwriting the previous copies of the files)
      6) Run install/update_to_latest.php by navigating your browser to "http://{your_domain}/{root_path}/install/update_to_latest.php"
      7) Delete the install folder
      If you did everything correctly, your forum should come up when you navigate to it (you are also updated to the latest version of phpBB). If it doesn't, the first thing you should check is the info you provided in config.php.
    If you want to save your MODs
      From the backup of the files you made, open config.php and edit it to reflect the new database. See this article if you need assistance. After you have done that, upload the entire backup to the server. If you did everything correctly, your forum should come up when you navigate to it. If it doesn't, the first thing you should check is the info you provided in config.php. If you are running an old version of phpBB, be sure to update. Instructions can be found here.


Fixing cookie/domain/script path settings
    If your domain or script path changed during the move, you will have trouble logging in because it will redirect to your old forum. Here is the fix for that.

    1) Download the Auto Cookies MOD
    2) Upload the 'install' folder in the zip to your phpBB's base directory
    3) Run cookie.php by pointing to the cookie.php file in your browser (http://www.yoursite.com/{phpbb_root}/install/cookie.php)
    4) Follow the instructions
    5) Delete the install folder
    6) Clear your browser's cookies and cache. Restart your browser
    7) Test


I hope this has been helpful. If you had a problem with something, please ask in the support forum. If there is a typo/error in this article, please email me

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