File: backup.md

package info (click to toggle)
lava 2026.02-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 31,436 kB
  • sloc: python: 83,095; javascript: 16,658; sh: 1,364; makefile: 328
file content (53 lines) | stat: -rw-r--r-- 1,361 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Backup LAVA

In order to backup LAVA you will have to backup both the database and specific
directories.

## Database

### For a native Debian install
The database is managed by
[PostgreSQL](../../../technical-references/services/postgresql.md). See the
[PostgreSQL documentation][pgsql-backup] for
details.

To backup the database run:

```shell
sudo -u lavaserver pg_dump lavaserver > lava-server.sql
```

### For the docker-compose solution
If you run your LAVA instance with [docker-compose](https://gitlab.com/lava/pkg/docker-compose),
you can backup the database like this:
```shell
docker exec --user postgres docker-compose_db_1 bash -c \
            "pg_dump --username=lavaserver lavaserver > /tmp/lavaserver.sql"
```

On the host, you can then retrieve the backup file.
Example:
```shell
docker cp docker-compose_db_1:/tmp/lavaserver.sql .
```

## Filesystem

The configuration files are stored in:

* `/etc/lava-coordinator/`
* `/etc/lava-dispatcher/`
* `/etc/lava-server/`

The data (job outputs, ...) are stored in `/var/lib/lava-server/default/media`.

To backup the filesystem run:

```shell
tar czf lava-server-etc.tar.gz /etc/lava-coordinator/ \
                               /etc/lava-dispatcher/ \
                               /etc/lava-server/
tar czf lava-server-data.tar.gz /var/lib/lava-server/default/media/
```

--8<-- "refs.txt"