Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: FTP's, Filezilla and file-migration
author: Erland Heen Halvorsen
tags: ftp, case study,
---

## Introduction

FTP, or "File Transfer Protocol" is in short a way to move files from one server over to another. FTP is one of the oldest protocols in internet history and have largely been replaced by newer technologies (SFTP, FTPS). None the less it has been a vital part of internett history, and it is the technology i have used to migrate my latest project, wich i will delve deeper in to. The FTP i have the most experience with is FileZilla, so that is the one i will use as an example for the most part.

## Brief History

- FTP was first introduced in 1971 by Abhay Bhushan. The initial focus was to transfer files between ARPANET nodes, (ARPANET was a precursor to the internet), and sharing files and information between mainframe computers and research stations.

- In 1985 FTP was defined into it's longest lasting form. Several features were introduced, and among them were:

1. Separate control and data channels for communication.
2. An active and passive mode for file transfer.
3. support for more types of files and format.

- During the 80's and 90's, FTP were the main and most used method of file transfer on the internet. FTP also evolved to be more user-friendly, meaning it took less technical skill to make use of.

- From the 2000's and onwards the use of FTP started to decline. the main reason was a lack of encryption, making the method vulnerable to security leaks.

- Https Became the new standard, and in the later years cloud storage like Google Drive, Dropbox and OneDrive became more common.

- By 2010 many of the big browsers (Chrome and Firefox Among others) started phasing out it's support for FTP.

## Main Features

As explain above, the reason and function of an FTP is to move files from one server to another. I have stated that i will focus on FileZilla, a program that supports FTP and SFTP.

To get the gist of FileZilla, it's an open-source initiative called The FileZilla Project. It was firstreleased in 2001, and it's an easy to use, drag and drop FTP client. The best part from my experience with FileZilla was the way it could easely handle big file transfers, (Up to 4GB). There is nothing worse than spending an hour transferring files and you get an error with 10 files left. This never happened while using FileZilla, and i downloaded and uploaded a LOT of files during my project.

FileZilla supports both FTP and SFTP:

- **FTP:** It's simple and fast, in open and secure networks. Altough it transfers data and credentials in plaintext, making it unsafe on untrusted networks.
It has also lost support on the big browsers.
- **SFTP:** Secure File Transfer Protocol. It provides encryption, ensuring the safety of your files. It is more common than FTP today, because of it's safety features. The only downside to SFTP is that because of the encryption, file transfers may take a while longer. I have not personally tested the difference between an encrypted transfer and a non encrypted one.

## Market Comparison

To start with my inexperienced opinion, I prefer having my files, docs and folders saved locally, and then to manually move them where i need them to be. Being a windows user i have only bad experiences with using the cloud (Looking at you OneDrive). That might just be becuase microsoft for some reason has set onedrive to be default download directory. But i find it unreliable and tedious. It also propmts you endlessly to buy more cloud storage.

This makes FileZilla great in my opinion. It leaves you and your files alone until you open it, connect to a server and click transfer.

You have of course other similar programs to FileZilla. Some of them are:

- **WinSCP** It's also free, but windows only. I tried this one out, but to me it offered no more than FileZilla, while FileZilla also were more intuitive.
- **Cyberduck** Commonly used for Mac, But also supports windows. Another free alternative that supports cloud integration.
- **Transit** A paid alternative. This one i have never tried (because it's paid), but it looks to be more advanced and for the experienced users. It supports SFTP/FTPS and cloud integration. Transit is only supported on MacOS.

To conclude, I started off with FileZilla and stayed with FileZilla. It's not a fantastic super-program that fixes all your problems, but it's beginner-friendly, handles bigger transfers, supports cross-platform and most importantly it's free. There is a paid version where you get cloud support and such, but i never had the need for my work.

It has also been critizized by some for how the installer bundles optional adware, but honestly which open-sorce installer dosen't. Just uncheck the box?

## Getting Started

Starting FileZilla is as easy as it can be. Just:

- Head to their website [FileZilla](https://filezilla-project.org/download.php?type=client)
- Download the client
- Follow the steps in the installer. (Remember to uncheck every additional download)
- Run FileZilla
- Enter Host name, Username and password. You can manually type wich port to use, but FTP defaults to 21 and SFTP to 22.
- Click connect and if the fields above are correct you will get a prompt saying "Connection to server established", and you will in a side-panel see all the available files on the server.

A thing i appreciate with FileZilla is the console since it displays what the client is doing at all times. This makes it easy to see if something has gone wrong, and it is usually good at telling you exactly what has gone wrong.

![Error](image.png)

In the image above i typed the wrong Password. In the next the password is correct.

![Succsess](image-1.png)

I also got a warning because i'm using FTP connection, which is as stated not secure.

## Conclusion

FTP is easy but not secure. It is being faced out by the large browsers and is mostly replaced by SFTP. For the user the difference is not that great. In fileZilla you just choose if you want to use a FTP connection or an SFTP. The host must of course support the method you are choosing to link the servers.

For my use it has proved an excellent tool, making transfers, backups and edits really simple.

## References

- [SNL](https://snl.no/FTP)
- [wp-beginner](https://www.wpbeginner.com/showcase/6-best-ftp-clients-for-wordpress-users/)
- [BizBot](https://bizbot.com/blog/10-best-ftp-clients-2024-secure-file-transfer/)
- [RFC](https://www.rfc-editor.org/rfc/rfc114.html)
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# In this example

I will explain how i used FileZilla ti migrate my WordPress site from one server to another.

## To start

Make Sure you have FileZilla installed and updated. Make your way to where your files are located. In my case i had my files stored with SYSE. I also had them locally of course which you always should have just in case, but for the sake of the process..
Log in to your hosting provider and make your way to the section where your webhost is. In my case it looked like this:

![alt text](image-2.png)

Here you should get all the information you nedd to connect FileZilla to the host.
You should be provided with a Host-name and a username. The password is something you create easely and can update at the control-panel or Cpanel or whatever the provider use. In my case it looked like this:

![alt text](image-3.png)

In the image above you can see that SYSE supports both FTP and SFTP.

In FileZilla, Open the site manager.

![alt text](image-4.png)

Fill in the information provided by your host:

![alt text](image-5.png)

And press Connect.

If connection is Succsessfull you will be met with a side-panel containing all available files from the Webhost. (Note, you will get a warning while using FTP, telling you that your files will be displayed in plain text. You can ignore it, or connect again using SFTP)

After a succsessfull connection FileZilla should look like this:

![alt text](image-6.png)

You can change the display, but for me (Default) i have my local files to my left, connected server to the right and console on the top. You also have to sections on either side. One for navigation (the top one), and one for file/folder management.

Now exactly where your website files belong can vary a bit, but to my knowledge the most common directories are WWW or public_html. With SYSE the correct directory was WWW. Locate the folder and open it. It should then look like this:

![alt text](image-7.png)

Note how i have two www folders. Make your way to the one under your username.

On the left side, make sure you are standing in the directory you want your files to end up. This is where the files will be transfered to. Whan that is done, mark all the files you want to download, right-click and press download. Like this:

![alt text](image-8.png)

This process may take some time. With my connectioen it toke about one and a half hours, but it depends on number of files transferred and your internet connection.

## Next steps, Backup

When all files have been downloaded it is always a good idea to make a copy of the folder containing the files. This is what we call a backup, and will most likely prove extreamly usefull shoul something go wrong. (I have never experienced a computer project that worked on the first try, so make a backup...)
You should also make a backup of your database, but since wordpress uses PHP, you dont need FileZilla for this. Just download the database directly from your providers phpmyadmin page (if supported).

Now that you have your files secured, you can navigate to the new providers controlpanel. In my case my customer were using Go Large Hosting (which was terrible and ancient, altough the costumer support were quick and polite). A problem i faced here was that Go Large used Cpanel, and i was struggeling to find the correct connection credentials. But when in doubt it's always an option to contact costumer service, and in this case they proved quite useful. I can not show pictures from Cpanel, since i would be displaying information belonging to my costumer.

When connected to the new host, make sure to do a backup of theire old files as well. In my opinion it's always good practise to be as cautious as possible when dealing with other peoples property. (i made three backups out of anxiety).

Now as stated before, the most common roots for a web-page were www and public_html. For me it was www, but with go large they had a public_html directory. It looked like this:

![alt text](image-9.png)

## Uploading files

So after you have found the correct directory and done all necessary backups, it's time to upload the new files to the target directory. Before you do this (and assuming you have taken backups) you must remove the old files from the directory. as before, mark all files you want to remove, right click and press delete.

![alt text](image-10.png)

Now head to the left panel and locate the directory containing the new files. When found make sure your target directory is the correct one and empty, mark your new local files, right-click and press upload. It should look like this:

![alt text](image-11.png)

Now, in the example above the server directory was not empty because it is my actual costumer's files. Also, you can uploud one and one file should you wish to make smaller changes.

Let's say i wanted to update my wp-config.php file (which is something you have to do when migrating a wordpress site). It needs to be updated because this is the file that links your database to your site. The process would go something like this:

- Locate the oridginal wp-config.php you have locally and make a backup.
- Enter the file using the preferred text editor (VScode for example).
- The section you are looking for is this:

```php
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'EXAMPLE' );

/** Database username */
define( 'DB_USER', 'EXAMPLE' );

/** Database password */
define( 'DB_PASSWORD', 'EXAMPLE' );

/** Database hostname */
define( 'DB_HOST', 'EXAMPLE' );
```

Here you will have to put in the correct credentials. If your website and database is hosted on the same server you can usually put 'localhost' into DB_HOST.

- When the right credentials are filled in you can save the document and close it.
- Go back to FileZilla and locate where your new wp-config file is, highlight it, and press upload. **(!Always make sure you are uploading to the correct directory!)**

![alt text](image-12.png)

- You may get a prompt asking if you wish to owerwrite. In this case you should only have one wp-config, (and you should have a backup), so it's fine to owerwrite.

To make sure the process have been done correctly, simply type in the domain in your browser. It should take you to your wordpress site. If something went wrong with your wp-config wordpress will tell you. Then you will get a notification saying there was an issue connecting to your database.
If you get a critical error, some of your files may have been corrupted during download or transfer.
For me it has worked to delete the files from the server and uploading them again, but make sure you are uploading all the necassary files.

## Conclusion

The process is fairly simple, but as with all things it can prove challanging the first time you do it. Also it depends on what hosting-service you use. When i tested this method i migrated from PRO ISP to SYSE, which is very similar in practice. This was easy, because all the information you needed was displayed in the same way.
When i moved to my costumers domain however, it was more of a challange.

Go Large Hosting were using Cpanel, and i needed spent more time finding the correct credentials to connect FileZilla to the server, and the information i needed to connect the database to the domain. I ended up contacting support, and made them fing the correct credentials for me.

In the end, as soon as you can connect FileZilla to the server it is simple to navigate, upload and download files. Most modern hosting-services support SFTP aswell, which makes the transfer safer, altough somewhat slower. I will probably continue to use FileZilla for this type of work.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.