Home Website TutorialsWordPress How to clone WordPress source code manually

How to clone WordPress source code manually

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

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
clone website 1
clone website 2

In the interface below, tick Select All => right click and select Compress to compress the source code

clone website 3
clone website 4
clone website 5

After the compression process is complete, double-click on the file name to download it to your computer

clone website 6

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.

clone website 7

The DB_NAME line will display the name of the database you need to download.

clone website 8

To download, go back to the HOME page and select Backup as shown below:

clone website 9

Then click on the database name to download to your computer.

clone website 10

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.

clone website 11

Select the database you just created and click Import

clone website 12

Click Choose file => find the downloaded database file and click Go

clone website 13
clone website 14

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).

clone website 15

Here you will see 2 records siteurl andhome . You need to correct it with the current website name.

clone website 16

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!

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign