To transfer a WordPress Website from one server to another or one hosting account to another, you have a few different options.
Please see the following if you are only looking to move the WordPress directory (within the same hosting)
e.g. https://letshosttutorials.com/wp > https://letshosttutorials.com
Moving WordPress to A New Website Address or Directory
One recommended option would be to use a WordPress Plugin to automate some of the process for you.
Two very common options for the migration of WordPress websites are:
- WPVivid
- Duplicator
You can choose any migration plugin you prefer (even ones not listed above), just something to be aware of is that some plugins you find are premium or may have limits on the free versions.
Each of those plugins will have its own steps/methods for moving a Website, so please take the time to read their documentation, generally the process would go as follows:
1: Install the migration plugin (Duplicator, WPVivid, etc.) on the “live”/”original” site and follow the onscreen instructions.
2: Download/export a backup of your site files and database locally to your desktop/downloads folder.
3: Install a new WordPress installation on the new account/directory and add the same migration plugin used to take the backup
4: Follow onscreen instructions to import the backup
Please see the following on how to manually move a WordPress site.
Manually moving a WordPress site can be broken up into two parts:
- The website files
- The database
1: Backing up the website files
Moving the files can be done from your hosting control panel (file manager) or using FTP, please see the following for information on how to connect to your hosting via FTP:
Using FileZilla To Connect To Your Hosting Account Via FTP
Whichever option you use the process will be much the same as below:
- Log into your cPanel/hosting account
-
Find the directory where the website files are stored/hosted:
The files for the “main” domain on the account will always be “/public_html”
You can access the files from the “File Manager” section in cPanel
If you are not sure or want to confirm the correct file path/directory for a website, you can view the correct directory from the “Domains” tab under the “Domains”
Addon/subdomains etc. can have their own custom directory where the website files are located, you can see the file path/directory for each domain under the “Document Root” section.
Once you know the correct file path, navigate back to the “File Manager”
- Select/highlight your public_html folder and click “Compress” in the top right.
Compression type = Zip Archive
You can change the name and directory where the file will be stored, we recommend using the default settings and clicking “Compress Files”
Addon domains can be stored in the public_html (e.g. public_html/wp etc.) so if you do not want to move them you can click into the public_html and select all files and (CTRL + left click to deselect) folders excluding the folders for addon/secondary domains then click “Compress” in the top right
- Once the files are compressed/zipped, you can right-click and download the file to your local downloads folder
zip files can take up a large amount of disk space so once you have your backup locally you can delete the zip from your hosting to free up the used disk space. - Login to the new server/hosting account and upload the zipped “public_html.zip” file into the new public_html folder.
- Unzip the file.
Please note depending on how you zipped the files you may end up with the folder being unzipped into a directory like “home/public_html/public_html” If this happens you can navigate into the public_html/public_html folder that contains your files, select all and use the “Move” option to move the files back into the /public_html folder.
2: Backing up the Database
To move your Database, you will need to make sure you are selecting the correct Database. You can find your Database name in your wp-config.php file, which is located in the public_html folder with your website files. Once you have opened the file, you can find your Database name:
/** The name of the database for WordPress */
define( 'DB_NAME', 'Your_Database_Name' );
To export the Database, navigate to phpMyAdmin in cPanel.
-
In the top left you will find all of the Databases connected to your account. From the list, click on the database name to select it.
-
In the top middle click on the 'Export' tab.
-
Export type = “Quick - display only the minimal options”
-
Format = SQL
-
Click 'Export'.
Setting up the new database
In your new hosting account's control panel, navigate to the Database section, "MySQL Databases" in cPanel
Create a new Database to facilitate the import of your previously exported .sql file.
You will need to enter a name for the database, the name can/will be different from the original database name as the beginning suffix will likely be not editable. This will not impact the import.
You can also create a Database User under the “Add New User” section, again it is fine if the name is different from the original user.
You will then need to add the new user to the database “Add User To Database” in cPanel.
Select the new “user” from the “User“ drop-down, select the new database name from the “Database” drop-down and click add. Grant that User access (with all privileges).
Import the database
To import the Database, navigate to the database administration section, phpMyAdmin in cPanel.
- Select the new database (should be at the top left in phpmyadmin)
- Navigate to the 'Import' section
- There should be an option to choose/drag-and-drop (“Browse” in cPanel). Select the .SQL file you had previously downloaded
- Once you have selected the correct file, click "Go". This will import the file and if successful, you should see a "Success" screen afterwards.
Final Steps:
You will need to make sure that your new installation of WordPress is updated with the database details. Navigate to your site's wp-config.php in your new hosting cPanel File Manager. Replace the database name, user, and password with the new credentials you have created in your MySQL Databases section in the previous step.
To view the site to make sure it has worked, you can use https://sitepreviewer.ie or update your Hosts file on: Windows or Mac
After the move, you can update your DNS/Nameservers to reflect the new Server/Hosting.
For instructions on updating the DNS nameservers of your domain, please visit:
How Do I Change My Domain Nameservers
If you have any questions on the above, please do not hesitate to 'Open a Ticket' and we will be happy to advise further.