• Wednesday, November 5, 2025

Migrating a website to a new hosting environment can seem daunting, but with a clear understanding of the process, it can be accomplished smoothly using cPanel. This guide will walk you through the essential steps to manually transfer your website's files and database from your old host to your new hosting provider.

Step 1: Locating Your Website Directory on the Old cPanel

The initial phase of any website migration involves securely retrieving your website files from your previous hosting server. While content management systems (CMS) like WordPress often offer specialized migration plugins that streamline the transfer process, including database migration, this guide focuses on the manual approach. This method is particularly useful for websites not built on such platforms or for those who prefer direct control over the migration.

To begin, log in to your existing cPanel account. Once inside, navigate to the 'Files' section and click on the 'File Manager' icon.

cPanel File Manager icon

Upon launching File Manager, you may be prompted to select a starting directory. If your website's specific directory is visible, select it. Otherwise, begin in the root folder, typically labeled as public_html. This directory is the standard location where most hosting providers store all public-facing website files. Double-click to enter public_html and navigate through the subfolders until you identify the one containing your website's core files.

As illustrated in the example below, a common scenario involves the website being housed within a subfolder, such as 'blog', within the public_html directory:

Website files inside 'blog' folder

Once you've located your website's primary folder, double-click to access its contents and verify that all your site's files are present. The next crucial step is to prepare these files for download.

Step 2: Compressing and Downloading Your Website Files

Website directories often house a substantial number of files, making individual downloads or even bulk transfers via FTP inefficient and time-consuming. To streamline the upload process to your new cPanel environment, it is highly recommended to compress all the files within your website's folder into a single archive before downloading.

To achieve this, click the 'Select All' checkbox located at the top of the File Manager interface, as depicted below:

Select all files in File Manager

After selecting all files, right-click anywhere within the highlighted selection and choose 'Compress' from the contextual menu. A dialogue box will then appear, prompting you to confirm the compression settings. Ensure the 'Zip Archive' option is selected, and then click 'Compress File(s)'. This action will consolidate all your files into a single .zip archive within the same directory. Once the compression process is complete, locate the newly created zip file, right-click on it, and select 'Download' to save the archive to your local computer. This process significantly simplifies the transfer, as illustrated here:

Downloaded zip file of website

With your website files securely downloaded, the next phase involves preparing your new hosting environment in cPanel for the incoming data.

Step 3: Establishing the New Website Folder in Your Hosting Account

Log into your new hosting provider's cPanel account. Navigate to the 'File Manager' and access the public_html directory, just as you did with your old host. Within public_html, create a new directory where your website will reside. To do this, click the '+Folder' icon typically found at the top of the File Manager interface:

Create new folder in cPanel File Manager

You will be prompted to enter a name for your new folder and confirm its location. It is crucial to ensure that this new directory is created within the public_html folder. Placing it elsewhere will prevent your website from being publicly accessible, as shown in the prompt:

Specify new folder name and location

Confirming these details will successfully create the dedicated folder for your website at the specified location within your new hosting environment.

Step 4: Uploading and Extracting Your Website Archive

Once the new folder has been created, double-click it to enter its directory. Next, locate and click the 'Upload' button positioned at the top of the File Manager window, as indicated in the illustration:

Upload button in File Manager

A new window will appear, presenting a 'Select File' button. Click this button, and a file dialogue box will open on your computer. Navigate to and select the compressed .zip file that you downloaded in Step 2. This action initiates the upload of your website archive to your cPanel. Please note that the upload duration will vary depending on the overall size of your website files.

File upload progress in cPanel

Upon completion of the upload, indicated by a full green progress bar, you can click to return to the File Manager. It's common for the newly uploaded file not to appear immediately; this is simply due to the interface not having refreshed. To resolve this, click the 'Reload' link, usually colored blue and located at the top of the File Manager. Your compressed .zip file will then become visible.

Extracting files in cPanel

As depicted in the image, right-click on the uploaded .zip file and select 'Extract'. A prompt will appear, requesting confirmation of the extraction destination. Verify that the current folder is correctly selected as the extraction location, then click 'Extract File(s)'. After the extraction process concludes, a list of the uncompressed files will be displayed, confirming the successful transfer of your website content.

As with the upload, a quick reload of the File Manager interface will reveal all your extracted website files now populating the new folder. This marks the successful completion of uploading your website files to your cPanel environment.

Migrating Your Website Database

Beyond merely transferring files, a complete website migration using cPanel necessitates the accurate relocation of your database. The database serves as the backbone of your website, storing crucial information such as content, user settings, widget configurations, and menu structures. Modern website platforms, particularly content management systems like WordPress, increasingly rely on the database to house a wider array of functionalities, including plugin settings and dynamic data. Therefore, moving the database is as critical as moving the files for ensuring your website functions correctly in its new home.

This section will guide you through the process of transferring the essential 'engine' of your site – its database – to your new hosting provider. Let's proceed with the steps involved.

Step 1: Identifying Your Existing Database Name

Before you can export your database from your current cPanel, you must first ascertain its exact name. For WordPress users, this critical piece of information can be found within the wp-config.php file, located in the root directory of your website. This configuration file holds all the vital connection parameters for your WordPress installation, including the database name, as highlighted in the following example:

Database name in wp-config.php

Step 2: Locating Your Database within phpMyAdmin

cPanel integrates a robust web-based tool called phpMyAdmin, which provides comprehensive capabilities for accessing and managing your databases. To utilize this tool, log into your cPanel account and search for the 'phpMyAdmin' icon, typically found under the 'Databases' section, as illustrated here:

phpMyAdmin icon in cPanel

Clicking the phpMyAdmin icon will grant you access to all databases associated with your hosting account. On the left-hand panel, locate the specific database name you identified in the previous step and click on it to select it. With your database selected, the next action is to export its contents into a file.

Step 3: Exporting Your Database

After selecting your database from the left-hand navigation pane, direct your attention to the tabs situated at the top of the phpMyAdmin interface. Click on the 'Export' tab to proceed with the database export:

Export tab in phpMyAdmin

The default export settings are typically sufficient for most migrations. Proceed by clicking the 'Go' button located at the bottom of the page. This action will initiate the download of your database to your local computer, usually as a .sql text file. The time required for this download will vary based on the size of your database; for instance, a moderately sized website might have a database of around 30 MB, which could take a few minutes to complete.

Step 4: Creating a New Database on Your New Hosting Provider

Prior to importing your exported database, it is essential to explicitly create a new database within your new cPanel environment. This preliminary step is necessary because direct database creation from within phpMyAdmin may sometimes be restricted by user permissions.

Therefore, log into your new hosting provider's cPanel account and click on the 'MySQL Databases' icon, which is usually found under the 'Databases' section, as illustrated below:

MySQL Databases icon in cPanel

Clicking this icon will present you with the database creation interface, prominently displayed at the top of the page. Here, you'll specify the details for your new database.

Enter new database name

The interface is typically divided into two sections, with the first part automatically pre-filled. This design enhances security by preventing easily guessable database names. Your task is to enter a unique suffix for your new database. You have the flexibility to choose any suitable suffix, or you might opt to reuse the suffix from your old database name for consistency. After entering the desired suffix, click 'Create Database' to finalize the creation process.

Step 5: Importing Your SQL Database File

Return to your cPanel dashboard and locate the 'phpMyAdmin' icon, which is now within your new hosting provider's control panel:

phpMyAdmin icon in new cPanel

Similar to your previous interaction, clicking this icon will open the database management section, where you should now observe the newly created database (from Step 4) listed on the left-hand side. Click on this database to select it.

With your new database selected, navigate to the 'Import' tab. Within this section, you will find a 'Choose File' button. Click this button to open a file selection dialogue and then locate and select the .sql database file that you downloaded in Step 3 of this guide.

Import tab with 'Choose File' button in phpMyAdmin

After selecting your database file, click the 'Go' button at the bottom of the page. This action will commence the import process. A successful import is typically indicated by a 'Success' message, confirming that your database has been fully transferred, as shown in the example:

Database import success message

Step 6: Updating Your Website's Configuration to Use the New Database

The final critical step is to configure your website's installation to connect to the newly imported database. For WordPress users, this involves navigating to the wp-config.php file within your website's root directory on your new hosting provider (as you did in Step 1). Open this file and, referencing the previous screenshot, carefully replace the old database name with the new one you created in Step 4. Ensure you update both the prefix and the suffix of the database name for a successful connection.

Please note that for other Content Management Systems (CMS) or custom-built websites, the method for updating database connection details will vary and may require consulting their specific documentation.

Congratulations! You have now successfully imported your database to your new hosting provider, complementing the file and folder transfer completed in the first part of this tutorial. This comprehensive process signifies the full migration of your website to its new home.