Nội dung
In this article, AZDIGI will guide you to perform Clone WordPress website from one website to another on hosting in the simplest “traditional” way.
Note: in this article, AZDIGI will do it on the cPanel interface, you can do it on other control panels with the same steps.
Step 1: Compress the entire website source code
To compress the source code, you need to access cPanel => File Manager. If your hosting has a lot of websites, you need to check exactly which folder the website needs to be cloned in to clone correctly.
Usually
- Folder
public_html
: belongs to the main domain - Folder
domain.com
: belongs to the addon domain
In the interface below, tick Select All => right click and select Compress to compress the source code
After the compression process is complete, double-click on the file name to download it to your computer
Step 2: Backup database
This step is quite important because the website cannot be without the database, so if you are unsure about the database name, you can go to the file wp-config.php
=> edit to see the database name.
The DB_NAME
line will display the name of the database you need to download.
To download, go back to the HOME page and select Backup as shown below:
Then click on the database name to download to your computer.
Step 3: Upload the source code and import the database to the new website
Note: After creating the database, you need to save the information DB_NAME
,DB_USER
andPassword
to perform the configuration in the next step.
After creating the database, uploading the source code to the host, you proceed to extract the source code and access phpMyAdmin to import the database. You can refer to how to upload files with File Manager and Create Database in the 2 instructions below. You can click here to see how.
Select the database you just created and click Import
Click Choose file => find the downloaded database file and click Go
Step 4: Edit the link for the website
After successfully importing the database, you need to edit the website link to match the current website to run it. To do this, click Database => wp_options (This prefix may different).
Here you will see 2 records siteurl
andhome
. You need to correct it with the current website name.
Step 5: Configure the database and wp-config.php file
This is also the final step to complete cloning a website. You open the wp-config.php
file. In this file, you need to pay attention to 3 values: DB name, DB user and Password. In the above step, you have created any information, then replace these 3 values in the file.
/** The name of the database for WordPress */ define( 'DB_NAME', 'dotrung2_dtrungquan' ); /** MySQL database username */ define( 'DB_USER', 'dotrung2_dtrungquan' ); /** MySQL database password */ define( 'DB_PASSWORD', 'iGNR^jN!W1q6' );
Wishing you success!