
-
Create a new domain in your cPanel account:
- Log in to your cPanel account.
- Look for the "Domains" or "Domains" section and click on it.
- Choose the option to add a new domain or subdomain.
- Enter the desired domain name for your new website and follow the prompts to create it.
-
Prepare your backup files:
- Ensure you have a backup of your WordPress website files and the associated database.
- If your backup is in the form of a compressed file (e.g., .zip), extract its contents to a folder on your computer.
-
Create a new MySQL database:
- In your cPanel account, look for the "Databases" section and click on "MySQL Databases" or a similar option.
- Create a new database by entering a name for it and clicking "Create Database".
- After creating the database, scroll down to the "MySQL Users" section, create a new user, and assign it to the database with appropriate privileges.
- Take note of the database name, username, and password, as you'll need them later.
-
Upload your website files to cPanel:
- Connect to your cPanel account using an FTP client (e.g., FileZilla) or the cPanel's built-in File Manager.
- Navigate to the directory where your new domain's files should be stored (usually public_html or a similar folder).
- Upload the extracted WordPress files from your backup to this directory.
-
Import your database:
- In your cPanel account, go to the "Databases" section and click on "phpMyAdmin" or a similar option.
- Select the database you created earlier from the left-hand sidebar.
- Click on the "Import" tab in the top menu.
- Choose the database file from your backup and click "Go" to import it.
-
Update WordPress configuration:
- Locate the file called "wp-config.php" within the directory where you uploaded your WordPress files.
- Edit the file using a text editor and update the following lines with your new database details:
-
define('DB_NAME', 'your_database_name'); define('DB_USER', 'your_database_username'); define('DB_PASSWORD', 'your_database_password'); define('DB_HOST', 'localhost');
- Update WordPress site URL:
- In the WordPress database, locate the table named
wp_options(the table prefix 'wp_' may vary). - Look for the
siteurlandhomerows, and update their values to reflect your new domain name. - Save the changes.
Test your website:
- Visit your new domain in a web browser and check if your WordPress site is functioning correctly.
- If everything is working fine, you can proceed to customize and configure your website as needed.
Remember to keep a backup of your original files and database before proceeding with these steps, as a precautionary measure.