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.comadded (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
-
Open Control Panel › Files › Import from another host.
-
Under Website files, fill in:
Field What to enter Copy into website example.comConnection 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.comLogin, Password the old FTP or SSH login Folder on the old server usually public_html -
Click Copy files.
The copy runs in the background. Copies shows its status.
3. Copy the database
- Open Databases › MySQL databases. Under Quick create, type a Name such as
siteand click Create. Copy the database name, user and password from the message. - 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.
- Click Copy database.
Note: if the old host doesn't allow remote MySQL connections, export a
.sqlfile there and use Import next to the database on MySQL databases instead.
4. Copy each mailbox
- Open Email › Email accounts and create each mailbox with the same address.
- 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.
- 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.comandwww.example.comat 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):
- Open Server Admin › Accounts › Import accounts.
- Under 1. The account backup, upload it (up to 1 GB), choose a file already in
/home/hostfog-import, or paste a download link. - Under 2. The new account, choose the Package and the Owner. Leave Username empty to keep the old one.
- Click Start import and follow the progress.
- 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.