Here are short instructions what you need to do in order to move / copy phpBB3 forum.
What you need in order to benefit from these instructions
- Basic UNIX command-line knowledge
- SSH access to the server
- MySQL access to the database
- LAMP stack ready on the new server
These instructions have been tested on Ubuntu/Debian/Linux but they should work in other environments too.
2. Write down database access information
Get password from config.php file on the old server:
cd /var/www/phpBB3 cat config.php
Write down database name, username and password.
3. Copy files
Use rsync to remotely copy forum files to a new computer. On new computer, in /var/www folder
rsync -av --compress-level=9 firstname.lastname@example.org:/var/www/phpBB3 .
4. Dump and copy database
Execute the following command on the new server. It takes SSH connection to the old server and dumps phpBB3 database to the new server over the SSH connection.
ssh email@example.com -C -o CompressionLevel=9 mysqldump -u databaseuser --password=databasepassword --skip-lock-tables --add-drop-table databasename > phpbb3.sql
5. Create a new database
Use the old access information from config.php to create a database with identical access information on the new server. You need a MySQL root access to create new databases.
mysql -uroot -p
Create database and grant access to phpBB3 user for it.
mysql> create database databasename;
mysql> GRANT ALL ON databasename.* TO 'databaseuser'@'localhost' identified by 'databasepassword';
Load the database on the new server from the dump file:
mysql> connect databasename;
mysql> source phpbb3.sql
6. Configure Apache virtualhost for the new server
The last step is to set-up Apache virtual host on the new server, so you can access the phpBB3 using a domain name. Note that this doesn’t need to be a real domain name, but you can spoof the domain name using /etc/hosts file on your local workstation.
Add file /etc/apache2/sites-enabled/phpbb3.conf (or pick a filename based on forum name if you host multiple forums)
<VirtualHost *> ServerName yourdomainname.com DocumentRoot /var/www/phpBB3 <Directory /> Options FollowSymLinks AllowOverride None </Directory> </VirtualHost>
Note that <virtualhost *> may change depending on how Apache has been set up to listen IP addresses and ports. Also if you are using a shared hosting package or VPS you might need to use the server control panel (cPanel) to do this step.
Then check if your new config file is ok and restart Apache:
apache2ctl configtest apache2ctl graceful
7. Hosts spoofing trick
If you are not having a DNS server of your own which you can use for the copy you can always use /etc/hosts file trick to spoof domain names. This way you can make Apache to serve the forum from the server even if the forum is not connected to any real domain name yet.