A simple bash script to move files over FTP / SSH from a source to a (different) destination server.
Current version: 0.1 (Beta Phase)
There are many cases where people want to transfer files and folders from a source server A
to a destination server B
(for example websites or backups). In most of the cases, the only possible solution to migrate a website to a new host is to download all files manually with a FTP client (like FileZilla) on your local computer and upload it to the new server afterwards. Direct transfers over FXP aren't possible in most of the cases due to restrictions in many (shared) webhosting packages. This small bash script will do the job for you!
If there is access to a VPS or Root Server C
, I suggest executing the script on that machine to use the benefits of the data centre and to protect your own hardware and internet bandwidth.
To use the script, these are the only things you need (will be installed with the install script):
- Linux machine (or Mac or Winodws 10 with Linux Subsystem installed)
ftp
installed (sudo apt install ftp
)lftp
installed (sudo apt install lftp
)sshpass
installed (sudo apt install sshpass
)
- Clone the repository and go into it
git clone https://github.com/mhellmeier/FTP-Move-Server-Files.git
cd FTP-Move-Server-Files
- Install requirements and set permissions if not already done or simple use the small install script
chmod +x install.sh
sh install.sh
- Start the transfer script and follow the instructions shown in your terminal
./moveServerFiles.sh
- Enjoy!
- The script asks for passwords to connect to the source and destination hosts. Keep in mind that these will be used in the commands (plaintext!) to connect and download / upload content. It can be a security concern if the commands will be stored in the log history
- To get rid of some certificate verification errors, the scripts doesn't make certificate checks
- Remember to open FTP / SSH relevant ports in your firewall
- Use it at your own risk!
Alle planned features, bugs and discussions can be found in the open issues.
Feel free to fork the project, work in your personal branch and create a pull request or you simple interact in the issue section.
This is an open source project! Every contribution is greatly appreciated!
Distributed under the MIT License. See LICENSE
for more information.
Project Link: https://github.com/mhellmeier/FTP-Move-Server-Files