File Transfers

Home
1 - Ubuntu 16.04 user setup
2 - Install Nginx
3 - Install Phusion Passenger
4 - Install MongoDB
5 - Python venv
6 - Deploy via Git
7 - Migrate Mongodb
Various commands
File transfers

From Ubuntu to Rackspace container

Source: support.rackspace.com
Use one of the following methods to transfer your data from your existing hosting provider to your new cloud server. The migration method that you use depends on the nature of your data.
Note: Back up the data on your existing server before you migrate it.

rsync

You can use rsync to connect the servers and transfer the data. The following steps describe how to establish communication between your existing server instance and new Rackspace server instance.

Log in as root to your existing server.

Verify whether rsync is installed on your existing server.

rsync -version

If rsync is not installed, install it based on your distribution.

apt-get install rsync

Use SSH to log in to your Rackspace server from your existing server. Generate an SSH key from your existing server if you have not done so already:

ssh-keygen -t rsa -b 4096 -v

Transfer your SSH key to your Rackspace server. Substitute your new Rackspace server’s IP address in the following command.

ssh-copy-id 111.344.65.781

Copy your existing server files by using rsync. Replace the IP address after root@ with the IP address of your Rackspace cloud server.

Note: Adjust the following command to fit your specific situation. For example, you might need additional excludes or to change the source and destination paths.

rsync --exclude="/sys/*" --exclude="/proc/*" -aHSKDvz -e ssh / root@111.344.65.781:/media/xvda/

Source: DigitalOcean
Note: use a trailing slash at end of source directory to transfer contents of directory instead of directory itself.

rsync flags

`-r` = recursive

`-a` = stands for "archive" and syncs recursively and preserves symbolic links, special and device files, modification times, group, owner, and permissions.

`-n` (or --dry-run) = dry-run for testing

`-P` = combines flags `--progress` and `--partial`

Sync with remote system

rsync -anP ~/dir1/ username@remote_host:destination_directory

OpenStack Swift

Source: Openstack

https://support.rackspace.com/how-to/cloud-files-uploading-large-files/

Example login via commandline

swift -A https://auth.api.rackspacecloud.com/v1.0 -U username -K api_key stat -v

Uploading multiple files. Important: be sure to call command from directory containing files to be uploaded.

swift -A https://auth.api.rackspacecloud.com/v1.0 -U username -K api_key upload <Rackspace container/folder> <file name_1> <filename_2> <filename_3> --changed --skip-identical