This guide assumes you have an existing website and domain name hosted with another provider, and you’re migrating it to MyHost. The process can take 2+ hours, so patience is required.
Overview
- Create a backup on your previous server.
- Copy the files and database to MyHost.
- Test your site.
- Update your DNS settings.
Prerequisites
On Your Existing Web Hosting
Create a backup on your previous server:
To ensure a smooth migration, you'll need to download your website's files and database. Follow these steps carefully:
-
Access Your Hosting Account:
Log into your existing web host account, and navigate to the File Manager (or use an FTP client like FileZilla). -
Locate Website Files:
- If your website is located in the main directory, you’ll find your files in the public_html folder.
- If your website is in a subdirectory, look for a folder named after your site. For example, it may be named example.com or a similar variation.
-
Download Website Files:
- Select all the files in the folder. If using File Manager, there’s typically an option to compress the folder into a .zip file.
- Download the zipped file to your computer. If you're using FTP, drag the files from your hosting account to your local machine.
-
Backup the Database:
- Log into your hosting account's control panel (like cPanel) and open phpMyAdmin.
- Select your website’s database from the left-hand panel. If you’re unsure of the name, it’s usually listed in your site's configuration files (like wp-config.php for WordPress).
- Click on the Export tab at the top of the page.
- Choose the Quick export method and select SQL as the format. Click Go to download the database to your computer.
-
Make note of PHP version and php.ini settings.
On MyHost
-
Login to cPanel
How do I login to cPanel? -
Upload Website Files:
- Upload the .zip to the public_html folder using File Manager, then unzip it.
How do I upload my website onto your server?
- Upload the .zip to the public_html folder using File Manager, then unzip it.
-
Create a Database and User:
- Navigate to cPanel -> MySQL Database Wizard
- Create a new database and user, assigning all privileges.
How to create a MySQL database
-
Import the Database:
- Navigate to cPanel -> phpMyAdmin
- Open phpMyAdmin, select the new database, and import the backup .sql file.
How do I backup/restore a MySQL database using phpMyAdmin?
-
Update Configuration Files:
After importing your database, you need to update your website's configuration file to match the new database details. The file and lines to update depend on the platform you're using:-
For WordPress
Edit the wp-config.php file in your website folder. Update the following lines:define('DB_NAME', 'your_database_name'); // Your database name define('DB_USER', 'your_database_user'); // Your database user define('DB_PASSWORD', 'your_database_password'); // Your database password define('DB_HOST', 'localhost'); // Database host
-
For Joomla
Edit the configuration.php file in your website folder. Update these lines:var $db = 'your_database_name'; // Your database name var $user = 'your_database_user'; // Your database user var $password = 'your_database_password'; // Your database password
-
For Drupal
Edit the sites/default/settings.php file. Update the following lines:'host' => 'localhost', // Database host 'database' => 'your_database_name', // Your database name 'username' => 'your_database_user', // Your database user 'password' => 'your_database_password', // Your database password
-
For PrestaShop
Edit the config/settings.inc.php file. Update these lines:define('_DB_SERVER_', 'localhost'); // Database host define('_DB_NAME_', 'your_database_name'); // Your database name define('_DB_USER_', 'your_database_user'); // Your database user define('_DB_PASSWD_', 'your_database_password'); // Your database password
-
For OpenCart
Edit the config.php file. Update the following lines:define('DB_HOSTNAME', 'localhost'); // Database host define('DB_DATABASE', 'your_database_name'); // Your database name define('DB_USERNAME', 'your_database_user'); // Your database user define('DB_PASSWORD', 'your_database_password'); // Your database password
-
For all platforms, ensure the DB_HOST or equivalent field is set to localhost.
Install a Self-Signed SSL Certificate:
Use the SSL/TLS Status tool in cPanel to generate a self-signed certificate for your domain.
How to install a self-signed SSL certificate in cPanel
Testing Your Site with the Hosts File
Testing your site on the new server before updating DNS is crucial to avoid downtime.
What is the 'hosts' file and how could I use it?
If your site is not loading properly when accessed via the hosts file, we recommend not proceeding. Consider contacting your web developer or our Sales Team for assistance or to request a migration quote.
Updating DNS Settings
You might want to perform this step during off-peak hours, as DNS propagation can take a few hours. During this time, visitors might see a warning message about your site not being secure due to missing SSL certificates, which will be installed after DNS propagation is complete.
Choose one of the following methods to update DNS:
Option 1: Changing Name Servers to MyHost
Update your domain registrar’s name servers to MyHost’s:
- ns1.myhost.co.nz
- ns2.myhost.co.nz
- ns3.myhost.co.nz
If you want to keep your emails hosted with your previous provider, ensure that all DNS records (e.g., MX, TXT) from the old host are recreated in MyHost’s Zone File.
Follow our guide on:
Do you offer DNS Management for Domains?
You can also transfer your domain to MyHost to keep everything in one place:
Information Regarding Domain Transfers
Option 2: Updating A Records
If you prefer to keep your current name servers, contact your DNS provider to update the A record to point to your server's IP and the A record for www to point to your domain, or refer to their documentation.
Note: The IP address of your server was included in your welcome email or can be found in cPanel under Shared IP Address
Checking DNS Propagation
Use tools like DNSChecker.org to monitor propagation. During this time, remember visitors may see a security warning due to the self-signed SSL certificate.
Final Steps
Installing a Let's Encrypt SSL Certificate:
Once DNS propagation is complete, replace the self-signed certificate with a free Let's Encrypt SSL certificate:
- Use cPanel -> SSL/TLS to install the certificate.
How To Enable AutoSSL in cPanel
If you need further assistance, contact our Sales team at sales@myhost.nz.