Chúc mừng Tết Trung Thu 15% off everything Shop the sale
Browse topics
Advanced All add-ons

Moving your forum to a new server or domain

Moving is copying the database and files, then updating a handful of settings. The order that avoids downtime, and what to do about your licenses.

Updated 3 min read By the D.C Style team

On this page

Before you start

Moving a XenForo forum means copying two things, the database and the forum's files, then pointing XenForo at its new home. Nothing needs reinstalling, and your add-ons move with everything else. The order below keeps downtime short and lets you test the new server before anyone else sees it.

1. Close the forum while you copy

Posts made after you copy the database would be lost. On the old server, untick Setup > Options > Board active > Board is active and set a short Inactive board message, such as "We're moving to a new server and will be back within the hour." Administrators can still browse and use the Admin CP.

2. Copy the database

Export the whole database with mysqldump or your host's tool, then import it into an empty database on the new server:

mysqldump -u USER -p DATABASE_NAME > forum.sql
mysql -u USER -p NEW_DATABASE_NAME < forum.sql

Keep the same character set. If your forum uses full Unicode (emoji), the new database must support utf8mb4, and $config['fullUnicode'] stays as it was in src/config.php.

3. Copy the files

Copy the whole XenForo folder, not just the code. The folders people forget are the ones that hold your content:

  • data: avatars, attachment thumbnails and files add-ons store, such as Thumbnail's generated images.
  • internal_data: attachments and other private files.
  • src/config.php: your settings.

After copying, make sure data and internal_data are writable by the web server on the new host.

4. Update src/config.php

Change the database details to the new server's:

$config['db']['host'] = 'localhost';
$config['db']['port'] = 3306;
$config['db']['username'] = 'new_user';
$config['db']['password'] = 'new_password';
$config['db']['dbname'] = 'new_database_name';

5. Test before you switch

Point only your own computer at the new server by adding a line to your computer's hosts file with the new server's IP address and your forum's domain. Browse the forum, post a test reply, open the Admin CP and check Logs > Server error log. Run Tools > File health check to confirm no files went missing on the way. Using the file health check.

If you use the Server based trigger for background jobs, add the cron job on the new server now. Cron entries and the job runner.

6. Switch DNS and reopen

Point your domain at the new server. DNS changes can take a while to reach everyone, so leave the old server closed rather than deleting it straight away. When traffic arrives at the new server, tick Board is active again.

If the domain changes too

Moving to a new address takes a few extra steps:

  • Set Setup > Options > Basic options > Board URL to the new address. XenForo uses it in emails, alerts and links.
  • Update anything outside XenForo that calls back to your forum's address. That includes sign-in apps under Setup > Service providers > Connected accounts, Payment profiles in the same section, and the redirect URI in Google Cloud if you use Google Drive Attachments.
  • Move your D.C Style licenses to the new domain on each license's Domain tab in My Licenses. What your license covers explains how often you can move one.

Tip: Take a fresh backup of the old server right before you start, even if you have a nightly one. Back up your forum.

Still stuck? Open a support ticket with your old and new addresses and what you've done so far, and we'll help you finish the move.

Did this guide help? Thanks! Glad it worked. Sorry about that. What went wrong? Thanks for telling us. We'll use it to improve this guide.

What went wrong?
Need a reply? Open a ticket instead.

Still stuck? Open a ticket