HF PanelDocsv1.0.0

Move a website from another host

Copy a website's files, database and email from your old host to HF Panel, test it, then switch DNS without downtime.

This tutorial moves one website, example.com, with its database and mailboxes, from another hosting company to HF Panel. Nothing changes at the old host until you switch DNS at the very end, so the site stays online the whole time. Plan about an hour, most of it copying.

You need:

  • a hosting account on HF Panel with example.com added (see Domains)
  • the FTP or SFTP login of the old host, the old database's details, and each mailbox's password
  • access to the domain's DNS

Tip: moving many whole accounts from your old server? Administrators can import full account backups instead: see step 8.

1. Lower the DNS TTL (a day before)

At the domain's current DNS provider, set the TTL of the A, www and MX records to 300 seconds. The switch in step 7 then reaches everyone within minutes.

2. Copy the website files

  1. Open Control Panel › Files › Import from another host.

  2. Under Website files, fill in:

    Field What to enter
    Copy into website example.com
    Connection SFTP (SSH) if the old host allows it, otherwise FTP with TLS (FTPS)
    Old server the old host's server name, for example ftp.oldhost.com
    Login, Password the old FTP or SSH login
    Folder on the old server usually public_html
  3. Click Copy files.

The copy runs in the background. Copies shows its status.

3. Copy the database

  1. Open Databases › MySQL databases. Under Quick create, type a Name such as site and click Create. Copy the database name, user and password from the message.
  2. Back on Import from another host, under Database, choose the new database in Copy into database and enter the old database server, its name, user and password.
  3. Click Copy database.

Note: if the old host doesn't allow remote MySQL connections, export a .sql file there and use Import next to the database on MySQL databases instead.

4. Copy each mailbox

  1. Open Email › Email accounts and create each mailbox with the same address.
  2. On Import from another host, under Mailbox (IMAP), choose the mailbox, enter the Old mail server, choose SSL (port 993), and enter the old Login and Password.
  3. Click Copy mail. Repeat for every mailbox.

Up to three copies run at a time.

5. Point the site at its new database

The site's configuration file still has the old database details. Open it in Files › File Manager and enter the new database name, user and password from step 3, with host localhost. For WordPress, the file is web/example.com/public_html/wp-config.php.

6. Test before you switch

Look at the copy before anyone else does:

  • Add a line to your own computer's hosts file that points example.com and www.example.com at the server's IP address. Your browser then opens the new copy while everyone else still sees the old one. Remove the line when you are done.
  • Check that the PHP version under Software › PHP settings matches what the site used before.

7. Switch DNS

When the copy works, follow Point a domain bought elsewhere: change the nameservers, or the A, www and MX records, to this server. Free SSL follows within minutes.

During the change some mail may still arrive at the old host. A day later, run Copy mail once more for each mailbox to bring over anything that arrived there, then cancel the old hosting.

8. Moving whole accounts (administrators)

From another server where you have full account backups (.tar.gz, .tgz, .tar or .tar.zst):

  1. Open Server Admin › Accounts › Import accounts.
  2. Under 1. The account backup, upload it (up to 1 GB), choose a file already in /home/hostfog-import, or paste a download link.
  3. Under 2. The new account, choose the Package and the Owner. Leave Username empty to keep the old one.
  4. Click Start import and follow the progress.
  5. Read Check these: when it is done, then point the domains at the server.

Websites, databases, mailboxes with their mail, forwarders, DNS records and cron jobs come across, and customers keep their passwords. See Migrating.