IMPORTANT: Most of the time, all you need to transfer a website is Duplicator. This manual is for those, who prefer not to use a plugin and do it all by hand.
In order to transfer a WordPress website (or pretty much any other one) to the new hosting, you will need its files and databases.
Download the files from the old hosting
First, download the files to your PC. In order to do this:
- Log into your website using FTP and copy its content to your PC.
- Create a separate folder for the website’s content — this way you will be sure that those file will not intermix with the others.
- Make sure that you are in the root folder of your website — you will need all of its contents.
- Download may take a lot of time.
Transfer the database
Just like files, you will need to download the database too.
- Log into your old hosting’s control panel.
- Go to PHPMyAdmin menu.
- Select the database that is connected to WordPress.
- Click on Export
- Choose Quick export method and SQL format.
- Click ОК and save the file when prompted
Now, you need to transfer the information from your old database to the new hosting. But first, you need to create a database there. To do this:
- Log into cPanel on Unihost.
- Go to the MySQL Databases menu
- Create a new database and user
Now you need to import the data from the old database to the new one.
- Go back to the cPanel’s main page.
- Go to phpMyAdmin menu.
- From the list to the left, select your new database.
- Click on Import.
- In the field File to import, select the file with the database you’ve downloaded earlier.
- Uncheck Partial Import.
- Make sure that the Format is set to SQL.
- Click GO.
Edit the files
In order for your website to recognize the new database, you need to edit wp-config.php,
- Open the folder on your PC, where you’ve downloaded your website.
- Find the file ‘wp-config.php’.
- Make a backup copy of it. Call it wp-config-old.php and save it to the safe place.
- Open the original file with any text editor.
- Find the line “define(‘DB_NAME’, ‘db_name’);” where db_name — the name of your old database
- Change it to the name of the new one.
- Repeat with “define(‘DB_USER’, ‘db_user’);” and “define(‘DB_PASSWORD’, ‘db_pass’);”. Change them to your new username and password respectively.
- Save the changes to the file
Upload the website’s files to the new hosting
- Log into your Unihost hosting by FTP and upload the files to it.
- Make sure you are in the root folder of your hosting before you start copying.
- Upload may take a lot of time.
Once the copying is over, check whether or not your website works.