Moving a non-WordPress website (a static HTML site, a custom PHP application, or any site without a one-click migration tool) mostly comes down to three things: copying your files, copying your database if you have one, and updating your domain's DNS only after you've confirmed everything works. Do it in that order and your site stays online the whole time.
Don't cancel or close your old hosting account until your new site has been fully tested and your domain's DNS has finished propagating. Keeping both accounts active for a few days is the safest way to avoid downtime.
Step 1: Back Up Your Website Files and Database
Start by downloading a complete copy of your site from your current host.
In cPanel
- Log in to your current hosting control panel and open File Manager.
- Select your website's root folder (usually public_html), then use Compress to create a single .zip archive, and download it to your computer.
- If your site uses a database, go to phpMyAdmin, select the database, and use Export with the Quick method to download a .sql file.
In DirectAdmin
- Log in to your current hosting control panel and open File Manager.
- Select your website's root folder (usually public_html), choose Compress, and download the resulting archive.
- If your site uses a database, open phpMyAdmin from the Databases section, select the database, and use Export to download a .sql file.
Step 2: Upload Everything to Your New Host
Once you have both the files archive and (if applicable) the database export saved locally, move them to the new hosting account.
In cPanel
- Open File Manager on the new account, navigate to public_html, and upload your .zip archive, then use Extract to unpack it.
- If you have a database, create a new database and database user in MySQL Databases, then open phpMyAdmin, select the new database, and use Import to upload your .sql file.
In DirectAdmin
- Open File Manager on the new account, navigate to public_html, and upload your archive, then use Extract.
- If you have a database, create a new database and user under the Databases section, then use phpMyAdmin to Import your .sql file into it.
Step 3: Update Your Site's Configuration
If your site connects to a database, open its configuration file (for example, config.php or a similarly named settings file) in File Manager's code editor and update the database name, database username, password, and host to match the new database you just created. The database host is usually localhost on both cPanel and DirectAdmin, but check with your new host if you're not sure.
Step 4: Test the Site Before Switching DNS
Before you touch your domain's DNS, confirm the site actually works on the new host. You can do this by editing your computer's hosts file to preview the site using your domain name, or by browsing to a temporary URL your new host provides.
Click through your site's main pages, test any forms or login areas, and check that images and styling load correctly. Fix anything broken now, while your live site (on the old host) is still serving visitors.
Step 5: Point Your Domain to the New Host
Once you're confident the new copy works, update your domain's nameservers or DNS records to point to the new hosting account. Expect a short window while the change propagates across the internet, during which some visitors may still see the old site.
For the DNS side of the move, see How to Point Your Domain to a New Host, and for the hosts-file preview trick mentioned in Step 4, see How to Preview Your Website Before Pointing Your Domain's DNS.
Once you can confirm the domain is loading from the new host for a few days and email (if hosted separately) is unaffected, it's safe to cancel service with your previous host.