Knowledgebase

Back to Migration Center

How To Migrate Website With Databases And Emails


This article will walk you through migrating your WestHost Site Manager account to cPanel. If you have any questions about the following steps, please contact our WestHost technical support team.

If you are looking to migrate your current Site Manager hosting account to our cPanel environment, you have come to the right place. This guide is meant to aid you in the process of quickly and easily moving your content to cPanel.


Step 1: Review Your Account For Compatibility Issues

Before you go any further, you should first review your account for any possible compatibility issues. We do have a review guide which you can find here. If you have questions about whether your Site Manager account is compatible with cPanel, please don’t hesitate to contact support and we will be happy to take a look for you.

Step 2: Get A cPanel Account

  1. Now that you’ve reviewed your account for migration, the next step is to sign up for a cPanel account here.

  2. Take a look at the available hosting packages on our website and determine which will best fit your needs. Once you’ve decided which hosting package you'd like, please sign up with the same primary domain as your Site Manager account. This will prevent you from running into content placement issues in the future. During the checkout process, you will be asked which domain you wish to create the hosting account. When this prompt appears, enter your Site Manager domain in the "Use an existing domain" field to continue. Click"Use Domain".

  3. This process will provide you a login to our Client Hosting Interface (CHI), which utilizes cPanel to manage your web site. If you need help, our sales team can answer any questions that you may have while ordering a cPanel account.

Step 3: Move Your Site Content

Next, you will need to move your website content to your CHI account (cPanel). To do so, you will need to use an FTP client such as Filezilla or you can use SSH. An SSH client like PuTTY will serve you well. If you’re using a Mac, you can use the terminal built into the system. Don't worry if you aren't familiar with these terms, this step simply comprises moving your website files from Site Manager to cPanel.

Step 3a: Move Site Content Using FTP

  1. If you’re using an FTP client like Filezilla or CyberDuck, you will need to download all the website files from Site Manager and then re-upload them to your cPanel account. We recommend that you create a folder or location on your computer to store your website’s files so that they don’t get misplaced.

  2. Connect via FTP to your old (Site Manager) account using the domain and your username/password associated with that account. Proceed with the migration by following instructions from the FTP program. First, download the program, run the program, and follows the necessary steps to enter your information and begin migrating your files.

  3. Your website’s files will be located in the directory /var/www/html. Locate this directory within the ‘Remote Site’ window of your FTP.

  4. Now, simply drag and drop the contents of the /var/www/html folder into the folder you have created on your local computer.

  5. Next, retrieve all of your databases. To do so, navigate to PhpMyAdmin. You can access this at ‘domain.com/pma’.

    • To download your databases to your computer, export them as .sql files. This will store all of the data in your database in a file so that you can later import it to your cPanel account. Click the ‘Export’ tab in PhpMyAdmin, and select the database you would like to export. Select the checkbox for ‘Save as File’ and enter a name for the file. A good choice for a name is to put the name of the database in the box so that your file will be <database>.sql)

    • Repeat this for all of the databases in your account excluding ‘mysql’, ‘test’, and ‘information_schema’.

    • Once complete, move the downloaded .sql files into the folder you created on your computer, and compress it into a .zip file.

  6. You now have all your website content on your computer ready to be moved to your cPanel account.

    To move your website content to your cPanel server, you must retrieve your FTP information for your cPanel account. You will need your cPanel username and password and the IP address for the cPanel account. Once you have your personal details, go ahead and transfer your files to the cPanel server. You can do so by uploading the folder that is on your computer to the public_html folder.

  7. Your content is now available on the cPanel server. Please skip Step 3b and move to Step 4.

Step 3b: Move Site Content Using SSH

SSH is another method of controlling the data on your website, but it is more complicated than using FTP. If you are confident in your SSH skills, try the following steps. If not, revert to step 3a.

  1. SSH into your Site Manager server using the format: 
    ssh username@domain.com and enter your password.

  2. You will need to make a migration folder for your content. To do so run the following commands:

    mkdir /migration
    mkdir /migration/sites
    mkdir /migration/databases
  3. Now, copy your website content into the /migration/sites folder:

    cp -r /var/www/html /migration/sites

    If you have any other content outside of /var/www/html, make sure you repeat the command above with any other directories.

  4. Next, you will need to make .sql files of all of your databases. This is a helpful command that will create .sql files for you and place them into /migration/databases.

    for in $(mysql -BNe 'show databases' grep -v "^mysql$\|information_schema\|^test$");do mysqldump $x > /migration/databases/$x.sql;done
  5. Tar your migration folder to get it ready to move the cPanel server:

    tar czf migration.tar.gz /migration

    Note that this command may take a few moments to execute.

  6. Once you have completed this task, you are ready to SCP to the cPanel server. You will need your cPanel password and username and the IP address for the cPanel account. Run the following command from your Site Manager server:

    scp migration.tar.gz cPanel_username@cPanel_IP_address:~

    Type 'yes' and enter your cPanel password.

  7. Your content is now available on the cPanel server.

Step 4: Set Up Your cPanel Account:

There are just a few more tasks to accomplish now that your content has been migrated to your cPanel server.

  1. Log into CHI with your username and password. 
  2. Click the ‘Shared Hosting’ tab
  3. Click the domain for which you want to configure shared hosting.
  4. Click 'cPanel' at the top of the page.
  5. Now that you are in the cPanel dashboard, any additional domains you have will need to be recreated. Follow the guide here.

  6. Note that you will also need to recreate your databases.

Step 5: Move Migrated Content

In this step, we will import your databases and move your website content into place. The instructions will vary depending on whether you used SSH or FTP to complete Step 3.

Step 5a: Move Migrated Content With FTP

1. In the cPanel dashboard, click the icon for ‘phpMyAdmin’. Then select the database you would like from inside the window located on the left-hand side of your screen. Click the ‘Import’ tab.

  • Click the ‘Browse’ button and select the corresponding .sql file for your database. Click ‘Open’. Next, click ‘Go’.
  • Repeat this for each of your databases and their corresponding SQL files.

2. Return to cPanel and click the icon for ‘File Manager’. Click the folder called public_html and you should see the folder you uploaded with your website content.

  • Enter the folder and click ‘Select All’. These files will need to be placed inside the ‘public_html’ directory. Click the ‘Move’ button and double-check that the file path matches the ‘public_html’.

3. Repeat this step for any additional domains or folders.

Step 5b: Move Migrated Content With SSH

  1. First, SSH into your cPanel account using: ssh cpanelusername@IPaddress and your cPanel password.
  2. Next, you will need to untar your content. Run the following command: 

    tar xzf migration.tar.gz

    Wait for the command to finish.

    It may take a few moments depending on the size of your content.

  3. Once that task is complete, cd to migration/databases.

    You must now run an import command for each .sql file in this directory. You will need the database user password you previously made when you created the databases in cPanel. Run the following command:

    mysql -u cpaneluser_admin -p cpaneluser_dbname < dbname.sql

    Repeat this command for each database and corresponding .sql file, replacing the dbname each time. 

  4. Now cd to migration/sites. You will be moving the content here to the root of the web server. You can simply run: 

    mv html/* ~/public_html

    Repeat this step with any other folders in your ‘migration/sites’ folder.

Step 6:  Modify Database Configuration Files

  1. The final step is to modify your database configuration files. You must update these files with your new database names, usernames, and passwords.
  2. If you are running WordPress, the configuration file is called ‘wp-config.php’. Open this file and modify the database name, user, and password to the versions created in the steps above.

  3. For other configuration files, make sure you follow the same format, modifying the file to update the name, user, and password.

Step 7: Migrate Your Email Account:

If you have emails that need to be migrated, please follow this guide to migrate your emails How To Migrate Email To cPanel

If you run into issues migrating your emails, please contact tech support and we'll help. Simply open a support ticket with us through the support tab inside your chi.westhost.com account and let us know the usernames and passwords, as well as the domain once you used to create your email accounts

Step 8: Test Your Work

  1. Before making any DNS changes, you’ll need to test your site. You can do so by using a temporary URL. The format is as follows:
    http://IPaddress/~cpanelusername

  2. Test the site and if it meets your expectations, then you are now you are ready to update the DNS.

Step 9: Update The DNS

To update your DNS you need to change the nameservers for your domain(s). To complete this task, log into the website where the domain is registered and update the nameservers to:

DNS1.WESTHOST.COM
DNS2.WESTHOST.COM
DNS3.WESTHOST.COM


This final step concludes your migration, you’re now live on your new cPanel server!


Related Articles

How To Migrate Website Without Databases Or Emails
How To Migrate Website and Emails Not Including Databases
Can WestHost Move My Account From Site Manager To cPanel
Do I Need To Move My Account From Site Manager To cPanel?
How To Export MIVA Merchant v4 Products

Can’t Find what you need?

No worries, Our experts are here to help.