This document provides a guideline for securely migrating files from an on-premises server to SFTP Location. The migration script includes configuration settings, batch script files for password or PPK-based authentication, and the necessary tools.
Before you start, ensure you have the following:
- Access to the on-premises server where the files are located.
- SFTP credentials.
- A zip file containing the migration script.
- Download the zip file containing the migration script to your on-premises server.
- Extract the contents of the zip file. It should contain:
config.ini(configuration file)file_transfer_pwd.bat(batch script for password-based authentication)file_transfer_ppk.bat(batch script for PPK-based authentication)
You need to download the psftp.exe(an SFTP client, i.e., general file transfer sessions much like FTP) depending upon your processor type:
- 32-bit: psftp.exe (via FTP)
- 64-bit: psftp.exe (via FTP)
Copy the psftp.exe to the above extracted folder.
Open the config.ini file in a text editor and provide the necessary details:
sftp_ip = <your_sftp_server_ip>
user = <your_username>
password = <your password if using password auth>
ppk_path = <path to your ppk file if using ppk auth>(Either password or PPK should be provided)
source_dir = <path to your data files folder>
hotel_name = <your hotel name>
file_type = <file format e.g. csv,zip,txt>- Look for Task Schedular in your windows machine.
- Once Task Schedular is opened click on Create Task option to create a new task.
- In general configuration give name to the task.
- After giving name also select user login settings and OS version for the task accordingly.
- Now select Triggers configuration and click on New.
- Choose when do you you want to run the task and do not forget to click on Enabled on bottom is not selected already.
- Select Actions configuration section and click on New.
- In Action select Start a program and give the path to the batch script of your choice in Program/Script option. Also do not forget to add the path to the Script folder in "Start in(Optional) configuration"
- Click OK for Task Configuration and also for the Task. Now your task is scheduled for the provided time and you can see it in Active Tasks
Based on your authentication method (password or PPK), run the appropriate batch script:
- Open Command Prompt.
- Navigate to the directory where you extracted the migration script.
- Run the following command:
file_transfer_pwd.bat
- Open Command Prompt.
- Navigate to the directory where you extracted the migration script.
- Run the following command:
file_transfer_ppk.bat
- Directory Structure: The script will create a directory structure on the remote server based on the file names and dates.
- Log File: The script generates a log file (
logfile.log) to track the progress and any errors encountered during the transfer.
This batch script is used for password-based authentication. It reads the configuration from config.ini and uses psftp.exe to transfer files.
This batch script is used for PPK-based authentication. It also reads the configuration from config.ini and uses psftp.exe to transfer files.
- Invalid Credentials: Ensure your SFTP credentials are correct in the
config.inifile. - Network Issues: Verify that the on-premises server can connect to the Google Cloud SFTP server.
- File Permissions: Ensure you have the necessary permissions to read files from the local directory and write to the remote directory.








