We have the next OLD situation:
The url is http://www.oldsite.com/board/
Database = old_db
Database_user = old_db_user
Database_password = old123
You want to move this board completely to a new location.
The url will become http://www.newsite.org/forum/
Database = new_db
Database_user = new_db_user
Database_password = new456
The examples i will give are based on the phpbb prefix. Of course, you can have another table prefix, so remember to adjust these when i mention an example.
This information is needed when moving to the new location.
If you don't have all this information, you have to contact your hosting company or webmaster to provide you with this information.
Step-by-step
- DISABLE your old board in acp->Board configuration (That way, no new posts will be added)
- Make a copy of the files OLD to the desktop of your PC (let's say we call this copy OLD) with any decent FTP Program (there are lots of very nice FTP-clients out there...)
- Make a copy of your database.
- Log into a mysql manager (phpmyadmin will do), select old_db at the left side (IMPORTANT) and choose EXPORT at the top tab.
- Now you are getting a screen with lots of options. Few are very important:
- CHECK Structure
- Inside structure CHECK: Add AUTO_INCREMENT value
- Inside structure CHECK: Enclose table and field names with backquotes
- CHECK Data
- Inside Data CHECK: Complete Inserts
- Inside Data UNCHECK: Extended inserts
- Make sure the other checkboxes inside are UNCHECKED and that the EXPORT TYPE is set to INSERT
- 1 box below that one, CHECK Save as File, leave the File name template (1): field as it is (__DB__)
- Set Compression to 'NONE' and press start.
- After a little while a save dialog will pop up, save the file with the default name to your desktop also and wait till downloading has finished.
- Now that you have a complete backup of the complete board on your desktop you can open the new location in your FTP Program.
- Upload all files to the appropriate directory (in our example it is the directory called 'Forum')
- When uploading is finished open up a webbrowser and browse to the new location. You should see a phpbb error stating it can't connect to the database. This is NORMAL for the situation we are currently in.
- OPEN the new database (select it in the list at the left side) in a mysql manager (phpmyadmin will do)
- Press the IMPORT tab
- At the top you will see a box named 'File to import'
- In the file selection box, select the file on your desktop that has the name of your OLD database and the extension .sql
- Leave the rest of the options "as is" and press go. BEWARE: If you use this method, only files smaller dan 2 MB (=2024Kb) can be uploaded!!!!!! At the bottom of this little titorial i will give you a hint of how to import bigger files.
- When the import has finished most of the work has been done. The only thing we need to do is make the files connect with your data again.
To get your board running and functioning correctly again, some minor adjustments to data and config file are needed.
- Open the phpbb_config table in phpmyadmin.
- Look for the next fields: script_path, server_name and server_protocol. These field together form the url of your (now OLD) installation and should reflect the information of your NEW installation, so you have to change them manually.
- Set server_protocol to 'http://' (if it wasn't already) or use 'https' if you are connecting to a secured url.
- Set server_name to (our example!!) 'www.newsite.org'
- Set script_path to (our example!!) 'forum'
- At this stage your database is in installed and working properly. The last thing we need to do is the to let the files connect to this database.
- At the root of your installation (in our example: http://www.newsite.org/forum/) is a file called config.php. Download it (or open the copy on your desktop in the directory you had, called 'OLD') and open it in a text-editor.
- The config file has about 10 short lines, but before we continue, DO NOT CHANGE OTHERS than needed and explained here in this tutorial !!!!
The (example) lines:- Code: Select all
$dbname = 'old_db';
$dbuser = 'old_db_user';
$dbpasswd = 'old123';
are the ones we need to change to reflect the information from the new database. So change them to:- Code: Select all
$dbname = 'new_db';
$dbuser = 'new_db_user';
$dbpasswd = 'new456';
MAKE SURE YOU LEAVE EVERYTHING ELSE ALONE, SO KEEP THE ' AND THE ; IN PLACE, JUST CHANGE THE TEXT!!! - Save and upload the config.php file, overwriting the old one and browse (again) to http://www.newsite.org/forum/. You should now have a (disabled) board running at the new location. You can login now, got to the acp and enable the board again to let your users post again.
- Good luck !
Notes:
If you want to learn how to use phpmyadmin, please check their website at http://www.phpmyadmin.net/home_page/index.php and look for the many tutorials on using phpmyadmin.
If you want to import larger databases (files) than the 2MB limit phpmyadmin is having than you need to get a copy of the (perfectly working) bigdump.php. Checkout the latest version and/or download the latest version at their site: http://www.ozerov.de/bigdump.php.
Problems:
If you get logged out of the NEW board after each and every page, then it's most likely a cookie problem. You can either click the "Delete all board cookies" on the index page, OR remove the cookies stored in your browser manually. (See the manual for your particular browser howto use this function)
If you still get the error: Cannot connect to database then the changes you've made to the config file arent correct. Please check if these settings are all correct.








