- 5 Minutes to read
- DarkLight
FTP Server
- 5 Minutes to read
- DarkLight
FTP, or File Transfer Protocol, is a standard network protocol used for transferring files between a client and a server on a computer network. An FTP server, also known as an FTP site or FTP host, is a server computer that hosts files and provides them to clients over the FTP protocol, facilitating the exchange of files and data across the internet or a local network.
Prerequisites
- You have an FTP server set up and accessible outside network.
- You have created a user account on the FTP server with
read
andwrite
permissions. - Ensure any firewalls or network security systems allow this connection.
Authorize Connection to FTP
In FTP
Please keep in mind that this guide provides general instructions, and your individual setup might need a different approach or some extra steps. Always take your organization's security guidelines into account when you're making these changes. Additionally, it's a good idea to seek assistance from a database administrator or an IT professional to make sure everything is set up correctly.
Enable Port Forwarding
Enable port forwarding to make sure your server is accessible from the Internet by following these steps.
- Assign a static IP to your server on your local network. This makes sure that the server's address remains constant, so other devices and services always know where to find it.
- Windows: You can set a static IP from the network settings.
- Linux: This is typically done by editing network configuration files, which vary by distribution (e.g., /etc/network/interfaces or /etc/netplan/ directory for Ubuntu).
- Configure port forwarding on your router. Log in to your router's web interface and look for a section called Port Forwarding, Virtual Server, or something similar. Create a new port forwarding rule:
- Service or Application: Name it e.g. FTP Server.
- Internal IP: Enter the static IP address of your server.
- Port Range: Depending on your server's configuration, this is typically port 21. For passive FTP, you'll need a range of ports (consult your FTP server's configuration to determine this).
- Protocol: Usually TCP.
- Configure your firewall to allow connection on the necessary ports. See our guide on how to allow network connection.
- [Optional: Skip if you have a cloud or virtual server.] Obtain a public IP address. If your network's IP address is dynamic (changes over time), you'll want to use a Dynamic DNS (DDNS) service. This gives you a domain name that automatically updates to point to your network's public IP address, even when it changes.
- Sign up with a DDNS provider and choose a domain name.
- Configure your router or a server application to update the DDNS service with your current public IP address.
Create User
Follow these steps to create a user with necessary permissions.
- In your interface, connect to the server by using the default host (127.0.0.1) and port (14147), unless you've changed these during setup.
- In the top menu, click on Edit and then select Users.
- Click on Add under the Users section, and a dialog box will pop up. Type the username and confirm.
- With the user selected, check the Password box in the Account settings and enter a strong password.
Configure Access Permissions
- Click on Shared folders from the page's left side and click on Add to choose a directory from your server that you want the user to access.
- Select your newly added directory. Below, you'll see Files and Directories permissions. Set the appropriate permissions by checking the following boxes:
- Read: The user can download files.
- Write: The user can upload files.
- Delete: The user can delete files and folders.
- Append: The user can append data to an existing file.
- Create: The user can create new directories or files.
- List: The user can list files and folders.
Allow Network Connection
For this destination, whitelisting IP addresses is not available in the database system. Instead, you can configure the network access at the firewall level. Here are the general steps:
- Identify the firewall that's protecting your service. This could be a Windows or Linux firewall running on the server itself, or it could be a network firewall.
- Open the firewall's configuration settings. This process will vary depending on the type of your firewall.
- Look for the setting that allows you to define inbound rules or policies.
- Create a new rule or policy that allows inbound traffic on the port that the service is using (the default is 21) from the Dataddo IP addresses.
- Save your changes and test the connection from Dataddo to make sure everything is working as intended.
In Dataddo
- On the Authorizers page, click on Authorize New Service and select FTP server.
- You will be asked to fill the following fields
- FTP Host: The address of your FTP server.
- Port: The port your FTP server is running on (default value is 21).
- Username: The username for the FTP account.
- Password: The password for the FTP account.
- Click on Save.
Create a New FTP Destination
- Under the Destinations tab, click on the Create Destination button and select the destination from the list.
- Select your account from the drop-down menu.
- Fill in the Path to your directory.
- Name your destination and click on Save to create your destination.
Click on Add new Authorizer in drop-down menu during authorizer selection and follow the on-screen prompts. You can also go to the Authorizers tab and click on Add New Service.
Creating a Flow to FTP Server
- Navigate to Flows and click on Create Flow.
- Click on Connect Your Data to add your source(s).
- Click on Connect Your Data Destination to add the destination.
- Choose the write mode and fill in the other required information.
- Check the Data Preview to see if your configuration is correct.
- Name your flow and click on Create Flow to finish the setup.
File Partitioning
File partitioning splits large datasets into smaller, manageable partitions, based on criteria like date. This technique enhances data organization, query performance, and management by grouping subsets of data with shared attributes.
During flow creation:
- Select one of the predefined file name patterns.
- Define your own custom name to suit your partitioning needs.
Example of a custom file name
When creating a custom file name, use variations of the offered file names.
For example, use a base file name and add a different date range pattern :
xyz_{{1d1|Ymd}}
Using this file name, Dataddo will create a new file named xyz
every day, e.g. xyz_20xx0101
, xyz_20xx0102
etc.