It appears that you're running an Ad-Blocker. This site is monetized by Advertising and by User Donations; we ask that if you find this site helpful that you whitelist us in your Ad-Blocker, or make a Donation to help aid in operating costs.

Migration Guide · Article

 

Summary


This guide is designed to help you migrate your forums from one webhost to another; it assumes you have some basic knowledge of linux/windows servers, and are capable of administering them.
If you are not comfortable with preforming a migration by yourself, our parent organization VNC Web Services offers Migration and Backup Services so that you can minimize any possible downtime.

Note
It is highly recommended that you first run the UBB.threads System Requirements Test on your new server prior to moving your files, as it will alert you to any potential configuration issues (such as the suhousin security module that can overwrite your configuration file with a 0 byte file, thus completely removing any settings on your UBB.threads install).



 

Backup Current Files


First we need to backup your current files, this is simple with the "tar" command in Linux/Unix/BSD via SSH (Secure Shell to the Command Line Interface) as:
tar -cvpzf my_ubb_backup.tgz /path/to/threads


Additionally, if you're on a "windows" machine you can zip the directory or use any other archival tools available on the machine; if you don't have any you could download them file by file via FTP but it will take quite a while.


 

Backup Database


Now you'll want to backup your database, you can do this from free tools like PHPMyAdmin, however, web based tools like PHPMyAdmin or the UBB.threads Backup Tool could hit the PHP Max Execution time limit and present you with an incomplete database backup. We recommend that you only backup your database via the Command Line Interface via a SSH (Secure Shell to the Command Line Interface to a Linux/Unix/BSD) as:
mysqldump -uusername -ppassword my_database_name > my_database_name.sql

Note
You can optionally use the -hhostname and -Pport trigger should you be communicating with a non-local SQL server; please note that most servers do not allow non-local access.


You can also compress the generated database backup via the "tar" command in SSH:
tar -cvpzf my_ubb_database.tgz my_database_name.sql


Alternatively, if you're on another OS or cannot use Linux command line tools, you can use web utilities like PHPMyAdmin to download an archive of your sql data. Please note that on large forums this is not recommended, and it is always recommended to use the "compression" options within PHPMyAdmin itself (tar/globalzip are recommended).

The Linux/Command Line versions will take MUCH less time to import/export, as you're not going through a php script which uses the web server; you're accessing the SQL server directly.


 

Transfer Files


Now you'll want to transfer your backups to your new server. You'd do this either by downloading the database and forum backups to your hard disk, and uploading them to the new server -OR- you can place them both in a web-accessible directory on your old server, and use the "wget" command in Linux/Unix/BSD to download them, ex:
wget http://www.yousite.tld/files/my_ubb_database.tgz
wget http://www.yoursite.tld/files/my_ubb_backup.tgz


From here you'll need to decide how you'll put the old files on the new server. If the new server is a Linux machine and you can access it via SSH and have access to "tar" and mysql command line this is a simple process. If your new server is windows based you'll want to be sure it has compression tools if you wish to place a compressed archive (that you likely created in steps 1 and 2) on it.

You'll want to decompress the files on the new server; in Linux/Unix/BSD with tar you'd do:
tar -xzvf my_ubb_backup.tgz
tar -xzvf my_ubb_database.tgz


Once tar has extracted the files, you'll want to change to the appropriate directories within the extracted files, and use the "mv" command to move the forum files to their proper new location, example (by not using a starting slash you tell the command to go from where you are now vs the physical path on the server):
cd the/directories/that/where/created/when/you/made/your/backup/
mv forum /the/new/location/of/your/forum


Now that the files are now on the new server, you need to update your permissions of files and directories, they may or may not have been carried over via your backup (if you used tar), so you'll want to make sure that your files are chmodded 666 and your directories 777.


 

Import Database


Now that the old files are on the new server, you need to import your database; you can again use PHPMyAdmin or use the command line to import the database. The command line way of doing this (note, this is not the MySQL command line, simply the Linux command line) would be:
mysql -h localhost -uuser -ppass database_name < databasebackupfile.sql

Note
You can optionally use the -hhostname and -Pport trigger should you be communicating with a non-local SQL server; please note that most servers do not allow non-local access.


The Linux/Command Line versions will take MUCH less time to import/export, as you're not going through a php script which uses the web server; you're accessing the SQL server directly.


 

Updating your Configuration File


After checking your permissions, you'll want to update your includes/config.inc.php file, updating the paths (and urls if they're different) for the new server. At the time I'm writing this article, these lines are:
'FULL_URL' => '',
'BASE_URL' => '',
'FULL_PATH' => '',
'SESSION_PATH' => '',
'REFERERS' => '',
'ATTACHMENTS_PATH' => '',
'ATTACHMENTS_URL' => '',


You'll also want to update the MySQL connect information in your includes/config.inc.php file:
'DATABASE_SERVER' => 'localhost',
'DATABASE_USER' => 'username',
'DATABASE_PASSWORD' => 'password',
'DATABASE_NAME' => 'databasename',
'TABLE_PREFIX' => 'table_prefix',
'HOMEPAGE_URL' => 'http://www.example.com',



 

Move Complete


From here, you should be completely moved over, it may sound quite difficult at first, but it's really not. Time can vary based on the size of your database, and some sites will be larger than others.
Note
Some overzealous system administrators at some web hosts do not allow users to utilize the Command Line Interface (CLI), even though SSH; which is a basic method of managing your site. If your web host does not allow access to your server's CLI, you might look for a host that allows you standard access to your web space; we have a list of Recommended Hosts available.

Posted By Gremelin Posted on October 5th, 2014 · Updated on January 13th, 2017
▼ Sponsored Links ▼
▲ Sponsored Links ▲

Comments

( Posted)