I’ve been asked many times how to migrate a website hosting without using any plugins.
I have to say that migrating a website is much easier than you would think, and in all honesty, something you can do yourself if you follow the steps below.
If you use WordPress and have a relatively small website, you can also use the duplicator plugin. However, my recommendation is to do the migration without plugins, because you will learn to migrate any type of web, regardless of the CMS you use and the size of it.
Step 1: Make a backup of your website
First we are going to download FileZilla. It is a totally free software. Once downloaded follow these steps to connect to your website:
- Download the FileZilla program – free
- Open it and click in the upper left corner
- Click on «Add Website»
- Connect with our old hosting
- Protocol: SFTP – SSH File Transfer Protocol
- Host: Go to your hosting to see it. Usually in hosting> Manage FTP or SFTP & SSH
- Port: Watch your hosting
- Logon Type: Normal
- User: See your hosting
- Below is a screenshot of my hosting where you can see the info to connect.
- Once connected, download the website to your computer and back it up.
When you download it, keep a back-up copy of the website that we want to migrate just in case we make a mistake while doing the migration. This is a mandatory step before starting the migration.
Step 2: Export the database from phpMyAdmin
The next step is very simple: Go to your old hosting and access the database.
Once we open phpMyAdmin, select the database you want to export. Choose the following:
- Quick – display only the minimal options
- Format: SQL
- Click GO
Once downloaded, we are ready to proceed to the next step.
Step 3: Create a new database in the new hosting
From the new hosting, we have to create a new database in the new hosting.
IMPORTANT: The type and version of database will have to be the same as the database that you exported in step 2. If you have a MySQL 5.5 database, the new database will have to be MySQL 5.5 and not MySQL 5.7.
Write down the database description and password, as we will need them shortly.
Step 4: Edit the wp-config file
Go back to the FileZilla program and look for the wp-config.php file.
Before editing the file, I recommend creating another back-up of the downloaded website. In one copy make the changes that I detail below, and the other keep in back-up mode.
Rename the database
define (‘DB_NAME’, ‘db_name’);
Replace the ‘db_name’ of our old database with the new database that you have created in the new hosting.
Change the database user
define (‘DB_USER’, ‘db_user’);
We must replace the ‘db_user’ of our old database with the new database that we have created in the new hosting.
Change the database password
define (‘DB_PASSWORD’, ‘db_pass’);
Replace the ‘db_pass’ of your old database with the new database that you created in the new hosting.
Change the database host
define (‘DB_HOST’, ‘db_host’);
Replace the ‘db_host’ of our old database with the new database that we have created in the new hosting.
Save the wp-config.php file once the changes have been made.
Step 5: Import the database
After you export the database, go to the new hosting> databases> phpMyAdmin> import
Upload the previously downloaded database:
- Uncheck Allow the interruption of an import in case the script detects that it is close to the PHP timeout limit. (This may be a good way to import large files; however it can break transactions.)
- Check the Enable foreign key check box
- Format: SQL
- SQL compatibility mode: None
- Mark Do not use AUTO_INCREMENT for zero values
- Step 6: Upload the website to the new hosting with FileZilla – FTP