First, if you haven't upload your system backup of Yunohost to a server using SSH, you can use the scp (secure copy) command, which is designed for transferring files securely over SSH.
Here is the basic syntax:
scp /path/to/local/file username@remote_host:/path/to/remote/directory
Example:
To upload a file named example.txt from your local machine to a directory /home/user/uploads on a remote server with the IP 192.168.1.10:
scp example.txt user@192.168.1.10:/home/user/uploads
To upload a directory:
If you want to upload an entire directory, use the -r option to recursively copy its contents:
scp -r /path/to/local/directory username@remote_host:/path/to/remote/directory
This will securely upload your files or directories to the server using SSH. Then make sure you have move the backup to /home/yunohost.backup/archives.
Then to restore a system backup on a YunoHost server via SSH, you can use YunoHost's built-in backup and restore functionalities. Here are the steps to restore a YunoHost system backup from the command line:
- List Available Backups
First, SSH into your YunoHost server and list the available backups to ensure the backup you want to restore is available:
yunohost backup list
This will show all the available backups.
- Restore the Backup
Once you have the name of the backup you want to restore, you can use the following command to restore the backup:
yunohost backup restore <backup_name>
For example:
yunohost backup restore 2024-09-10-xxxxxx
- Restore Specific Parts (Optional)
You can also restore specific parts of a backup, such as system configurations, apps, or data:
To list parts of a backup:
yunohost backup info <backup_name>
To restore only specific parts (e.g., apps or system):
yunohost backup restore <backup_name> --apps
yunohost backup restore <backup_name> --system
- Forcing Restore (if errors occur)
If there are any conflicts or errors during the restore process (for example, if some apps are already installed), you can use the --force option to overwrite existing data:
yunohost backup restore <backup_name> --force
Notes:
Backups are usually stored in /home/yunohost.backup/archives/.
Ensure you have sufficient permissions and that the backup file is intact.