# Moving data

There are several ways to get data onto a server and off it. This page helps you choose. The commands are in [Moving files](/docs/moving-files).

## Compare the methods

| Method | Best for | Needs | Notes |
|---|---|---|---|
| `scp` | A few files | SSH key, running server | Simple, starts over if it stops |
| `rsync` | Folders and repeated copies | SSH key, running server | Continues where it left off and copies only changes |
| **Transfers > Copy between servers** | A folder from one of your servers to another | Both servers running | Overwrites files with the same name. Each server runs one transfer at a time. Cancelling cannot stop data already in flight |
| Volume | Data that must outlive a server | Created before the server | Lives on one machine. Cannot be resized or moved |
| Helper script to your own bucket | Copies in your own S3-compatible bucket, on every account | SSH access, bucket keys | Run on the server. See [Back up to your own storage](/docs/backups) |

## Pick quickly

1. **Dataset or checkpoints from your computer:** use `rsync` so a broken connection does not start over.
2. **One result file back:** `scp`.
3. **Move work between two of your servers:** **Copy between servers**.
4. **Keep data when you destroy servers often:** a volume, mounted at deploy time.
5. **A copy outside our service:** copy it to your own computer or your own storage.

## The disk is not a backup

A server's own disk goes away when you destroy the server, and when the host's rental period ends (the data is then deleted about 48 hours after the server stops). Stopping a server keeps the disk. Copy anything you cannot recreate somewhere else.

## Speed tips

- Compress many small files into one archive first:

```bash
tar -czf data.tar.gz ./data
```

- Check free space on the server before a big copy:

```bash
df -h
```

- Data transfer is not metered, so there is no per-GB charge. The time is limited by your own connection and the host's network speed shown in the configuration details.
- Run long copies inside `tmux` or `screen` on the server so closing your laptop does not stop them.

## Volumes in short

A volume is created with a size and a region, and both are fixed. A server can use it only if it runs on the same machine, so deploying with a volume narrows the machines that qualify and can fail with no capacity. It is mounted at the path you choose (default `/workspace`) when the server is created and released when that server is destroyed. It cannot be attached to a running server. Volumes are charged from creation, also when unused.
