Step by step guide to move or host Xenforo forum on WPEngine where Wordpress is at the root of a domain and Xenforo inside forum sub folder.
WPEngine is the best WordPress managed hosts and so my client wanted me to move his WordPress site along with Xenforo forum to WPEngine. (I do recommend WPEngine as well)
Here are the 4 steps to move or host Xenforo forum on WPEngine where WordPress is at the root of a domain and Xenforo inside forum sub folder.
If you wish to just add a new forum to your WPEngine hosted WordPress site, just upload the files using sFTP like Filezilla to WPEngine.
If you are moving your WordPress + Xenforo from other hosts, WPEngine provides an auto migration script as a plugin in WordPress which backs up your WordPress data and moves them over to WPEngine but it will not provide you an option to move other scripts like Xenforo to move over.
Either you can manually backup forum files from existing host in a compressed format but you cannot upload the same using sFTP in compress format because WPEngine does not provide a CPanel like file manager where you can uncompress the folders on the server. So you have to uncompress and then upload the files. Uploading forum with a lot of data can be a big task.
So here is a trick to move the forum using WPEngine’s auto migration plugin.
All you have to do is copy the forum folder into the wp-content folder using file manager with your old host. It will then be moved over to the WPEngine server in the auto migration script. Once the folder is there in WPEngine, use Filezilla to move the content back to where it should be with respect to the root of the domain.
Hurray!! Now you have moved your forum files to WP Engine.
Once you have moved the files, now it’s time to move the database. I prefer to keep WP and XF in the same database as it helps with a single sign on feature if needed in future but even if you have them on separate database, you may need to move them to a single database on WPEngine.
Backup xenforo tables from the old server. Use tables that start with xf_. If you aren’t sure you can back up the whole database as well. It will overwrite the WP tables when you import and once you have settled things with the forum, you can move WP once again using the auto migration script and it will remove the overwrites done from your manual sql backup restore operation on WordPress tables.
You can login to WPEngine and for each of the WordPress install, in your account you can see a phpMyAdmin link in the left navigation.
Import your forum database backup. If your forum backup is bigger than 500MB allowed upload limit in phpMyAdmin, you can use bigdump to restore or can even use MySQLDumper to backup and restore database.
3. Xenforo Config
We have the database and the files on WPEngine. Now it’s time to connect to the database by changing the config files of Xenforo.
Ideally you can open the WordPress config file and set the credentials for database connection and set them in Xenforo config but at times WPEngine resets the password for your WordPress and updates the config file with the new password. It happened with my client and WPEngine people did this because they had an attack on their server and some data were leaked.
Such incidents can break your forum and so it is better to be reading the details from the wp-config file and use those details in xenforo.
Just add the following text at the top of the Xenforo config just after the opening PHP tag aka <?php
define('WP_PATH', dirname(dirname(dirname(__FILE__)))); require_once(WP_PATH.'/wp-config.php');
Now for the database connection details use the following.
$config['db']['host'] = DB_HOST; $config['db']['port'] = '3306'; $config['db']['username'] = DB_USER; $config['db']['password'] = DB_PASSWORD; $config['db']['dbname'] = DB_NAME;
Remember that DB_HOST is without quotation marks.
4. Caching Issue
Once you have your forum up and running on xenforo, it can have issues with caching. Users may not be able to login because the pages are cached and users logged in may see cached unlogin page of xenforo.
Open a support ticket and let them know to disable caching for the forum folder.
Remember to check file uploading in message editor or sending emails from Xenforo works.
That’s it. Now you can run a Xenforo from from WPEngine hosting.
Remember WPEngine will not support or upgrade your Xenforo because they are just managed host for WordPress. Installing xenforo is not against the TOS of WPEngine usage or anything but it is just not covered under the managed hosting that they provide for WordPress. You are completely OK to install or use any custom script in your hosting space provided.
Further Reading …