# Back up your server

> Keep a copy of everything Songstress knows, so you can put it back on any machine.

Page: https://songstress.app/docs/admin/backups/

Everything Songstress keeps is in its `data` folder: the database with everyone's accounts, playlists, likes and
history, your settings, and its caches. Your music is in your own music folder, which Songstress doesn't back up.
Back that up as you always have.

## What to keep [#what-to-keep]

- **The `data` folder.** You can leave out its caches, `data/transcode-cache` and `data/artwork-cache`: Songstress
  makes them again.
- **`data/songstress-secret.key`**, or your `SONGSTRESS_SECRET_KEY` if you set one. Without it, the saved sign-ins of
  people's connected accounts and extensions can't be read, and they connect again.
- **`compose.yaml` and `.env`.**

## Make a backup [#make-a-backup]

1. Stop Songstress, so the database is still:

   ```sh title="Terminal"
   cd ~/songstress
   docker compose stop
   ```

2. Copy what to keep:

   ```sh title="Terminal"
   tar czf ~/songstress-backup.tar.gz --exclude=data/transcode-cache --exclude=data/artwork-cache data compose.yaml .env
   ```

3. Start it again: `docker compose start`.

## Put it back [#put-it-back]

1. On the machine, put `compose.yaml`, `.env` and the `data` folder in a folder for Songstress.
2. Check that `MUSIC_DIR` in `.env` points at your music on this machine.
3. Run `docker compose up -d`, with the same release you backed up, or a newer one.
