The first thing to have ready is the login details for your "old" and "new" hosting accounts, that is, the username and password for both cPanel logins.
1. Log in to the cPanel of the hosting account you are migrating from. Depending on the theme you have selected, the layout may differ, but after logging in you will see the following options under "Files":
2. As highlighted in the image above, select FTP Accounts. We will set up an FTP account so that we can transfer files from one server to another using an FTP client. When you click FTP Accounts , the following is displayed first:
3. Enter the required information:
Log In: the username used to log in to the FTP client*
Domain: the domain of the website you are transferring
Password: a password with a strength of at least 70
Password (Again): re-enter the password
Directory: the root folder the user will be able to access (in the example above, access to everything located under /home/user)
Quota: how much data the user is allowed to transfer. Set a limit in the upper option, or select the lower option if you want it to be unlimited
*in the example above, the username for FTP login would be "zabec@primer.si"
"Scroll" down and you will see that a new account has been added:
4. Before we start working in the FTP client, we will download the databases (mySQL Database) to your computer. In addition to the files that make up the website itself, a database is also required for it to work correctly. To download the databases, first open phpMyAdmin, which is located in cPanel under "Databases:"
5. A view opens with a list of databases on the left. Each website has its own database, so make sure you identify the one that belongs to the website you are transferring. If you are transferring all of your websites, download all of the databases. In any case, you will need to work out which database belongs to which website, as this information will also be important for the final step.
6. Download each database separately. On the left, click the database you want to download, then click the "Export" button.
When you click "Export", a file named after the database with the extension .sql will be downloaded. In the example above, the file wp_db654321.sql is downloaded to your computer. We will need this file again when we import all the data into the new hosting account. Make a note of where it has been downloaded and saved.
7. Next, we will download the website files themselves to your computer. For this we need an FTP client. In our example we will use WinSCP; FileZilla is also a popular choice. Logging in to the server is similar in all clients. In the program, select File protocol "FTP". As the Host name, enter the name of the server you are connecting to (the server of your "old" hosting, from which we will download the files). The Port number is 21. User name is the username we chose when creating the FTP account, and Password is the password we set:
8. When we click "Login", the client connects to the server. In this step we will download the "website" to your computer. On the left side, select the destination where the files will be saved. On the right side, select the folder you will download from the server to your computer. This is usually the "public_html" folder. Click it, then click "Download" at the top.
9. The process will take some time, depending on the size of the website. Once the files have been downloaded, log out of the server and log in to the server of your newly ordered hosting. In the control panel of the new hosting, repeat the steps above for creating an FTP account. Use these details to log in to the FTP client again. This time we will upload the files we have just downloaded to your computer. On the left side you will find the directory where the files are stored. On the right side you will find the destination, which in most cases is again "public_html".
10. That's it: the website itself has now been successfully transferred to the new server. For it to work correctly, however, we also need to upload the databases that we downloaded to your computer in one of the previous steps. For this purpose we will create a new database in the control panel. Under "Databases", click "MySQL Databases".
The database prefix is determined automatically based on the username (in our example zabec_), and in the field highlighted in red you enter the name of the database. You can give it the same name as on the previous server, but this is not mandatory. Once you have entered the database name, simply click "Create Database".
11. The new database has been created, but we still need to assign a user to it. First, we create the user, in a similar way to how we created the database, except that here we also need to set a password for access. The name you choose can be the same as the one you chose for the database, or it can be something different. Here, too, the password strength must be 70. We will need this username and password again shortly, so make sure you save them somewhere!
12. In the next step, we need to connect this database to the newly created database user. You do this under the "Add user to database" option, where you select the desired database and user and click "Add".
13. Next, we add the so-called permissions, or privileges, to the user. If you are migrating your own website, grant all privileges by clicking "All Privileges" and then "Make Changes".
14. Now we will import the data from the previous hosting into this new database, using the .sql files we exported from phpMyAdmin. Following the instructions above, open phpMyAdmin again. On the left side you will see the database we have just created. Click it, then click the Import tab, as shown in the image. Next, click "Browse" and find the .sql file we downloaded from the previous hosting (in our example it was wp_db654321.sql). Once you have selected the file to import, click "Go" at the bottom.
With this, all the necessary files and databases have been uploaded to the new server. We are very close: all that remains is to modify the WordPress wpconfig file. This file contains the database information (database name, user, password). Because the file still contains the details from the previous hosting, you now need to change them and enter the details we created on the new hosting. You can edit the wp-config file through the FTP client or through the File Manager in the control panel. In our example we will use the FTP client.
15. In the FTP client on the new server, open the "public_html" folder and find the file wp-config.php. Click it to select it, then click the "Edit" button at the top.
16. It is important that you change the details highlighted below. These still apply to the old hosting, whereas on the new server we have set a different database name, user and password. We now need to correct them. First, here are the old details:
17. Change them to the new ones. Enter the database name, user and password that we set. For our example, this would look as follows:
Now simply save the file, and that's it. The migration process is complete!
You also need to change the DNS servers on the domain that belongs to the website. If your domain is registered with us, you can do this in the Moj Žabec system.
Before you do so, we always recommend testing that the website works on the new server first. You can do this by modifying your hosts file.
Congratulations! You have successfully migrated your website to a new server.