# Nodetool refresh

**refresh** - Load newly placed SSTables to the system without a restart.

Add the files to the upload directory, by default it is located under `/var/lib/scylla/data/keyspace_name/table_name-UUID/upload`

[Materialized Views (MV)](https://docs.scylladb.com/manual/master/cql/mv.md) and [Secondary Indexes (SI)](https://docs.scylladb.com/manual/master/cql/secondary-indexes.md) of the upload table, and if they exist, they are automatically updated. Uploading MV or SI SSTables is not required and will fail.

#### NOTE
ScyllaDB node will ignore the partitions in the sstables which are not assigned to this node. For example, if sstable are copied from a different node.

#### NOTE
`nodetool refresh` (with or without `--load-and-stream`) runs in the same I/O scheduling
group as backup and restore, and is therefore throttled by the
[backup_io_throughput_mb_per_sec](https://docs.scylladb.com/manual/master/reference/configuration-parameters.md#confprop-backup-io-throughput-mb-per-sec) setting rather than
[stream_io_throughput_mb_per_sec](https://docs.scylladb.com/manual/master/reference/configuration-parameters.md#confprop-stream-io-throughput-mb-per-sec).

Execute the `nodetool refresh` command

`nodetool refresh <my_keyspace> <my_table>`

For example:

`/var/lib/scylla/data/nba/player_stats-91cd2060f99d11e6a47/upload`

`nodetool refresh nba player_stats`

<a id="nodetool-refresh-load-and-stream"></a>

## Load and Stream

```default
nodetool refresh <my_keyspace> <my_table> [(--load-and-stream | -las) [[(--primary-replica-only | -pro)] | [--scope <scope>]]]
```

The Load and Stream feature extends nodetool refresh.

The `--load-and-stream` option loads arbitrary sstables into the cluster by reading the sstable data and streaming each partition to the replica(s) that owns it. In addition, the `--scope` and `--primary-replica-only` options are applied to filter the set of target replicas for each partition.  For example, say the old cluster has 6 nodes and the new cluster has 3 nodes. One can copy the sstables from the old cluster to any of the new nodes and trigger refresh with load and stream.

Load and Stream make restores and migrations much easier:

* You can place sstable from every node to every node
* No need to run nodetool cleanup to remove unused data

With `--primary-replica-only` (or `-pro`) option, only the primary replica of each partition in an sstable will be used as the target.
`--primary-replica-only` must be applied together with `--load-and-stream`.
`--primary-replica-only` cannot be used with `--scope`, they are mutually exclusive.
`--primary-replica-only` requires repair to be run after the load and stream operation is completed.

## Scope

The scope parameter describes the subset of cluster nodes where you want to load data:

* node - On the local node.
* rack - On the local rack.
* dc - In the datacenter (DC) where the local node lives.
* all (default) - Everywhere across the cluster.

Scope supports a variety of options for filtering out the destination nodes.
On one extreme, one node is given all SStables with the scope `all`; on the other extreme, all
nodes are loading only their own SStables with the scope `node`. In between, you can choose
a subset of nodes to load only SStables that belong to the rack or DC.

This option is only valid when using the `--load-and-stream` option.

## Skip cleanup

```default
nodetool refresh <my_keyspace> <my_table> [--skip-cleanup]
```

When loading an SSTable, Scylla will cleanup it from keys that the node is not responsible for. To skip this step, use the `--skip-cleanup` option.
See [nodetool cleanup](https://docs.scylladb.com/manual/master/operating-scylla/nodetool-commands/cleanup.md#nodetool-cleanup-cmd).

## Skip reshape

```default
nodetool refresh <my_keyspace> <my_table> [--skip-reshape]
```

When refreshing, the SSTables to load might be out of shape, Scylla will attempt to reshape them if that’s the case. To skip this step, use the `--skip-reshape` option.

[Nodetool Reference](https://docs.scylladb.com/manual/master/operating-scylla/nodetool.md)
