SFTP Gateway 3.0 adds a number of improvements such as:
- The ability to read and write directly to S3
- Folder management to allow multiple users to read and write to the same location.
If you are an existing SFTP Gateway customer running version 2.x, you can migrate your users and settings to a new SFTP Gateway 3.0 stack.
You can also migrate from one 3.0 stack to another. Use this to upgrade a single instance to high availability architecture. Or quickly spin up your setup in a different region as a cold failover.
This involves 3 main steps:
- Run an export script to generate a YAML file
- Transfer the YAML file to the new server
- Import the YAML file into the web admin UI
Export existing users
SSH into your 2.0 server, and run the following commands:
cd /home/ec2-user/ wget http://www.sftpgateway.com/backup-and-recovery/backup.py sudo python backup.py
This downloads and runs the export script, generating a new file:
This YAML file contains your global settings, as well as the settings for each SFTP user.
Take a look, and make sure each setting is correct.
Note: For migrating from 1.0, run the following commands:
cd /home/ec2-user/ wget https://s3.amazonaws.com/thorntech-public-documents/sftpgateway/migration-scripts/sftpgw-export.py sudo python sftpgw-export.py
Transfer the YAML file
The backup artifact is saved in this location:
Copy the backup artifact to
/home/ec2-user/ so that you can
download the file via SFTP or SCP.
cd /opt/sftpgw/backups/ cp -a sftpgw-*.tar.gz /home/ec2-user/
Download the YAML file from the old server to your local Mac:
scp -i <private.key> ec2-user@<old-server-public-ip>:/home/ec2-user/sftpgw-*.tar.gz .
The backup artifact will be in
.tar.gz format. Extract this file:
tar xzvpf sftpgw-*.tar.gz
The extracted contents will include a YAML file.
Import users into the new server
Open the web admin UI and log in.
Go to the Settings page, and import the YAML file.
Importing the YAML file should be self-explanatory. But here is a video that goes through this process, for reference: