# How to properly backup and restore?

**URL:** https://forum.yunohost.org/t/how-to-properly-backup-and-restore/12583
**Category:** Discuss
**Tags:** english
**Created:** [September 5, 2020, 9:07pm UTC](https://forum.yunohost.org/t/how-to-properly-backup-and-restore/12583 "2020-09-05T21:07:58Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [September 6, 2020, 7:11pm UTC](https://forum.yunohost.org/t/how-to-properly-backup-and-restore/12583/3 "2020-09-06T19:11:58Z")

</div>

## To check your backup

```auto
cd /home/BORG_USER/backup
borg list ./

```

You will be asked for the passphase you give during borg\_ynh install.

You can check specifically an archive by:

```auto
borg list ./::ARCHIVE_NAME

```

You can check integrity by listing info.json file, and check if db are correctly backupped up:

```auto
borg list ./::ARCHIVE_NAME | grep info.json
borg list ./::ARCHIVE_NAME | grep db.sql
borg list ./::ARCHIVE_NAME | grep dump.sql

```

## Restore an archive

To restore an archive with YunoHost \<=4.0.7 (current version), you can recreate a tar.gz of the app or part you need to restore:

```auto
borg export-tar BORG_USER@DOMAIN_OF_BACKUP_SERVER:backup::auto_XXXX /home/yunohost.backup/archives/auto_XXXX.tar.gz

yunohost backup restore auto_XXXX

```

CAUTION: Borg and BorgServer split backup in several archives (one for the conf, one for the data, one per app…), so you need to restore in this order if you want to do a complete restoration.

You need enough bandwidth, and space to do this operation…

Tips: if you backup nextcloud data, but want only restore nextcloud without data (because you already have the data dir in the new server), you can exclude the dir:

```auto
borg export-tar -e apps/nextcloud/backup/home/yunohost.app BORG_USER@DOMAIN_OF_BACKUP_SERVER:backup::auto_XXXX /home/yunohost.backup/archives/auto_XXXX.tar.gz

```

---

_[View the full topic](https://forum.yunohost.org/t/how-to-properly-backup-and-restore/12583)._
