How to move an existing site over yourself without downtime. The idea is simple: copy everything across, test it on the new server, and only then switch the domain.
Before you start
- Do not touch your DNS yet. The old site keeps running until the very last step.
- Make sure your new plan has room for the site (see the disk space on your plan) and that you know your PHP version needs (Choosing and changing the PHP version).
Steps
- Files. Zip the site on the old host and download it, then upload and extract it in
public_html(Uploading files with File Manager or FTP). A full copy of the web folder is what you want, including.htaccess(Showing hidden files and .htaccess in cPanel). - Database. Export it from phpMyAdmin on the old host. On the new account create an empty database and user, then import the file (Creating databases and using phpMyAdmin).
- Config file. Edit the database name, user, password and host in your site's config (
wp-config.phpfor WordPress). The host is almost alwayslocalhost. - Test before switching. Add a line to the
hostsfile on your own computer that maps your domain to the server IP shown in cPanel (Shared IP Address on the right of the home page). Your computer then loads the new copy while everyone else still sees the old one. Remove the line when you finish. - Email. Create the same mailboxes (Setting up email accounts and SMTP) and copy over old messages with an email program, by adding both accounts over IMAP and dragging folders across.
- Switch. Lower the TTL on your DNS records a day ahead if you can, then point the domain to DGT Host (Pointing your domain to DGT Host).
- Afterwards. Check forms, logins and the padlock (Installing an SSL certificate). Keep the old hosting for a few days before cancelling it.
If it doesn't work
- "Error establishing a database connection": the details in the config file do not match. Remember the username prefix.
- Pages show 404 apart from the home page: save Settings, then Permalinks in WordPress (Fixing 404 errors in WordPress).
- Images or links point to the old address: the database still holds old URLs. A search-and-replace plugin fixes that safely.
- Stuck? Open a ticket (Opening a support ticket that gets answered quickly) with the domain and what you see.