# Export and reload a session

Source: https://libtmux.org/en/py/stable/workspace/guides/export-session/

> Capture a running session, inspect the document and load a second copy.

Use the session created by the [installation walkthrough](https://libtmux.org/en/py/stable/workspace/guides/installation/).
Capture it to a new YAML destination:

```console
$ tmuxp freeze \
    -L workspace-guide \
    --workspace-format yaml \
    --save-to captured-workspace.yaml \
    --yes \
    workspace-guide
```

Review the output file. Capture cannot reconstruct original scripts, shell
history, plugin decisions, comments, or every application's state. Compare
window and pane topology, directories, layouts, environment, and options
explicitly.

Replay under a new name on the same dedicated server:

```console
$ tmuxp load \
    -L workspace-guide \
    -d \
    -s workspace-replay \
    captured-workspace.yaml
```

Inspect the replay:

```console
$ tmux -L workspace-guide list-panes -t '=workspace-replay'
```

Remove the replay when finished:

```console
$ tmux -L workspace-guide kill-session -t '=workspace-replay'
```

The [freeze reference](https://libtmux.org/en/py/stable/workspace/cli/freeze/) explains prompts and overwrite
behavior. [convert](https://libtmux.org/en/py/stable/workspace/cli/convert/) changes document representation without
validating whether a workspace can be loaded.

[tmuxp reference source](https://github.com/tmux-python/tmuxp/blob/618b398acc05506d3c682906c36cdeb29dcfa1ff/src/tmuxp/cli/__init__.py).
