Add streamlined backup and restore procedures for YAMS
This commit is contained in:
parent
22941325f0
commit
2a35976152
@ -8,66 +8,73 @@ summary: Backup your YAMS configuration.
|
|||||||
|
|
||||||
Your YAMS configuration is located in your YAMS install directory.
|
Your YAMS configuration is located in your YAMS install directory.
|
||||||
|
|
||||||
## Create a backup
|
## Create a Backup
|
||||||
|
|
||||||
For the purposes of this tutorial, I'll assume your YAMS install directory is `/opt/yams`, and that you want to create a backup on your `~` directory.
|
To create a backup, run:
|
||||||
|
|
||||||
First, go to the YAMS install directory and do a `ls`. You should see the `config` folder right there:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd /opt/yams/
|
yams backup [destination]
|
||||||
/opt/yams$ ls
|
|
||||||
|
|
||||||
# Output
|
|
||||||
config docker-compose.yaml
|
|
||||||
```
|
```
|
||||||
|
|
||||||
To create a backup, just run:
|
Where the destination is the location where you want the `.tar.gz` file to be saved. For example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
/opt/yams/config$ tar -czvf ~/yams-backup.tar.gz config/*
|
yams backup ~/backups/
|
||||||
```
|
```
|
||||||
|
|
||||||
`tar` is going to compress and create a `.tar.gz` file called `yams-backup.tar.gz` on the `~` directory.
|
The output will be:
|
||||||
|
|
||||||
Remember you should store your backups in a secure location!
|
|
||||||
|
|
||||||
## Restore a backup
|
|
||||||
|
|
||||||
For the purposes of this tutorial, I'll assume your YAMS install directory is `/opt/yams`, and that the backup is located in `~/yams-backup.tar.gz`.
|
|
||||||
|
|
||||||
To restore a backup, first stop YAMS:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ yams stop
|
Stopping YAMS services...
|
||||||
|
|
||||||
|
Backing up YAMS to /home/roger...
|
||||||
|
This may take a while depending on the size of your installation.
|
||||||
|
Please wait... ⌛
|
||||||
|
|
||||||
|
Backup completed! 🎉
|
||||||
|
Starting YAMS services...
|
||||||
|
|
||||||
|
Backup completed successfully! 🎉
|
||||||
|
Backup file: /home/roger/yams-backup-2024-12-23-1734966570.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, go to your YAMS install directory and delete everything inside the `config` folder.
|
## Restore a Backup
|
||||||
|
|
||||||
|
Restoring a backup is simple:
|
||||||
|
|
||||||
|
1. Extract your backup in the new location and `cd` into it:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd /opt/yams
|
tar -xzvf your-backup.tar.gz /your/new/location
|
||||||
/opt/yams$ rm -r config/*
|
cd /your/new/location
|
||||||
```
|
```
|
||||||
|
|
||||||
Now, untar the backup file on your YAMS install directory.
|
2. Edit the YAMS binary with the new information. You don't have to use `vim`; you can use your favorite text editor:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
/opt/yams$ tar -xzvf ~/yams-backup.tar.gz
|
vim yams
|
||||||
```
|
```
|
||||||
|
|
||||||
If you see all the folders inside the `config` directory, it means it worked!
|
3. Update `your/install/location` with your new install location:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
/opt/yams$ ls config
|
set -euo pipefail
|
||||||
|
|
||||||
# Output
|
dc="docker compose -f your/install/location/docker-compose.yaml -f your/install/location/docker-compose.custom.yaml" # -> Change this!
|
||||||
bazarr emby gluetun prowlarr qbittorrent radarr sonarr
|
install_directory="your/install/location" # -> Change this!
|
||||||
```
|
```
|
||||||
|
|
||||||
Finally, restart YAMS
|
4. Move the `yams` script to `/usr/local/bin/`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
/opt/yams$ yams start
|
sudo cp yams /usr/local/bin/
|
||||||
```
|
```
|
||||||
|
|
||||||
Everything should be running as expected, with your backup up and running!
|
5. Start YAMS:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yams start
|
||||||
|
```
|
||||||
|
|
||||||
|
And that's it! YAMS should now be up and running.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user