In this tutorial, you will learn how to manually transfer or restore your websites, files, databases and emails for primary domain, addon domains(s) and their subdomains (if any) from your previous host to MechanicWeb.
It will also cover the information on how to manually restore a full cPanel backup or Home folder backup (sites, databases and emails). It will help you to protect your data and will allow you to merge/separate a few cPanel accounts.
NOTE: This will overwrite all the current files.
Below you will find an easy step-by-step example with the general tips to separate/merge a few cPanel accounts or to restore the full/partial backups.
A. Create and Upload Backup
B. Restoring Websites/Files
C. Restoring Databases
D. Updating Configuration Files
E. Restoring Emails
F. Restoring Subdomains
Legend
domain.com – primary domain associated with your cPanel account
addon.com – domain added as an addon to the same cPanel account
backup-2012_06-17-54_domain.tar.gz - file name of the cPanel full backup
domain.com has website1 without a database installed on it and website2 on addon.com is a WordPress based website.
A. Create and Upload Backup
Create a full cPanel backup of your account with the old hosting provider, download and upload it to your home directory via FTP. Let's assume that the backup file name is backup-2012_06-17-54_domain.tar.gz as mentioned in the legend.
B. Restoring Websites/Files
01.
Go to cPanel home and open your File Manager.
02.
Right click on backup-2012_06-17-54_domain.tar.gz and click Extract or click on the corresponding button in the top bar of your File Manager. A pop up window will appear.
03.
Click on Extract Files in the pop up window. You can also specify the path to restore the archive to, but let’s leave it empty. A list containing the list of restored/extracted files will appear as Extraction result, close it.
04.
Click on the Reload button on the top and you will see the newly created backup folder backup-2012_06-17-54_domain. There will be many different folders inside this folder.
05.
Go to backup-2012_06-17-54_domain > homedir > public_html
It is the document root for the domain.com so it contains all files for website1 (website without a database). Also, there is a folder addon.com, which is the document root for addon.com domain with website2 (Wordpress based website) files. There might be other folders, for example, document root for the subdomains of domain.com or addon.com.
You will need to copy everything from here (backup folder's public_html) to public_html folder (located outside your backup folder, which is currently empty).
That is, you will need to copy everything from homedir/backup-2012_06-17-54_domain/homedir/public_html/ to homedir/public_html/ folder (which is currently empty).
06.
Click on Select all, right click and click Copy. A pop up window will appear.
07.
In the pop up window enter /public_html and click on Copy files.
All the website files should be inside your homedir/public_html now.
C. Restoring Databases
You will find the backups of all the MySQL databases under mysql folder located inside backup-2012_06-17-54_domain. folder. Find the mysql folder from inside the backup-2012_06-17-54_domain folder and open it. You will see some .sql files. These are the backups of your MySQL databases. They might be named respectively to your domain name.
Website1 doesn't have any database, website2 has a database named wbpl_wpmhq.sql (WordPress database). You can also get the database name from wp-config.php file.
Right click on wbpl_wpmhq.sql and download it to your PC.
Now we need to restore the database. There are 2 ways to do this:
03. Restoration from cPanel > Backups
i.
Go to cPanel home > Backups > Restore a MySQL Database. Click Choose File.
ii.
Choose the previously downloaded wbpl_wpmhq.sql file on your PC and click Upload. Once uploading is complete, you will need to create and assign a database user to the database.
iii.
Go to cPanel home > MySQL databases.
iv.
Under MySQL Users Add New User, type in the database user and password (save the password, you will need it later).
v.
Add the database user to the database wbpl_wpmhq.sql, in the pop up window check the option All Privileges and click on save changes.
If everything is correct, you will be able to see your newly created database user assigned to the database wbpl_wpmhq.sql.
04. Restoration from cPanel > phpMyAdmin
i.
Create a database, database user and password in cPanel home > MySQL Databases.
ii.
Go to cPanel home > phpMyAdmin.
iii.
Click on the plus (+) icon on the left of the cPanel username on phpMyAdmin and click on the database name.
iv.
Click on Import in the right top bar and browse to wbpl_wpmhq.sql file on your PC.
v.
Scroll down and click Go to start the import.
You will see a green notification if your database was successfully imported.
D. Updating Configuration Files
01.
Open the restored public_html folder and browse to the addon.com folder, find the WordPress wp-config.php file, which contains database details. Select it, right click and choose edit.
02.
Find the following 3 lines (database name, user and password), change the characters inside quotes with the database name, database username and database password created/restored/imported earlier:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wp-solid-mtup');/** MySQL database username */
define('DB_USER', 'wp-solid-mtup');/** MySQL database password */
define('DB_PASSWORD', '123456');
03.
Check for any specific caching plugins that may reference a path like /home/oldusername/public_html or /home/oldusername/public_html/addon.com, you should change it to /home/newusername/public_html or /home/newusername/public_html/addon.com respectively for example.
04.
Save the file.
That’s all for WordPress based site on addon.com. Your website2 should be live now. domain.com didn't have a database, so this step is not necessary for website1.
E. Restoring Emails
You can restore emails from a full cPanel backup.
If you had an email account info@domain.com with your old host and have a full cPanel backup, you will be able to transfer/restore the emails on your new hosting account with MechanicWeb.
You will also be able to restore deleted emails from a full cPanel backup. For example, you had some emails in info@domain.com and occasionally deleted it. You will be able to restore deleted emails from a full cPanel backup.
01.
Go to cPanel home > Email Accounts and create the account info@domain.com. If you have any other email accounts, create those as well. It is necessary to recreate the same mailbox before restoring email.
02.
Go to backup folder > homedir folder > open the mail folder. There should be a folder named .info@domain_com (note the dot before the email address). It contains all your folders with emails.
03.
Open .info@domain_com folder, click Select all and click Copy. A pop up window will appear.
04.
In the pop up window, put the following path: /mail/.info@domain_com and click Copy files.
That’s all, check your emails via webmail or an email client.
F. Restoring Subdomains
If you have any subdomains of your primary domain/addon domain(s), you can also restore the websites, email and databases associated with them.
You will need to create the subdomains before you can retsore the websites and emails for the subdomains.
01.
Go to cPanel home > Subdomains.
02.
Create the subdomain. Note down the document root folder name/location for the subdomain
03.
If your subdomain directory is inside the public_html directory, you will not need to restore files. However, if your subdomain directory is outside of your public_html, follow the guidelines mentioned in B. Restoring Websites/Files to restore the website/files but put the files inside the newly created subdomain directory instead of public_html.
04.
Follow the guidelines mentioned above to restore email, databases and configuration files.
Take a note that configuration files and folders may vary from one hosting provider/script template to another, but the main points remain the same. If you cannot find the corresponding files or not sure what details to put, feel free to contact us.