How to Backup from command-line Interface?

I want to backup the mails and baikal. How to do it using command-line interface ?
And suppose the hard disk crashed, how to restore the backed up files to new server ?

The backup system is not implemented yet (as of october, 20th), but it is the most important point of our roadmap :wink:

Hello. I saw that some applications have “backup” and “restore” scripts. Do you know how to use them please?

Those scripts are the first version of the backup system. It enables you to fully backup a YunoHost instance in a tarball and restore it on another instance.

For now it is not really usable, but @jerome is working on it :wink:

I had several difficulties with my YunoHost installation… I tried to copy (dd) the sdcard where the system is installed in order to be able to restore it, but when I try, I have to make an fsck at reboot and then I can’t restart mySQLd. I tried several times and failed each time.
Now, I’d like to backup my system in another way.

While the «backup» app is not ready, could someone tell me how to backup YunoHost? What are the files/directory to save? How to save the database? How to restore it ?

Thanks @jerome, for the work you are doing, that we are waiting for…

You can use mysqldump to backup every databases you have.

The command look like:

sudo mysqldump -uroot -p"$(sudo cat /etc/yunohost/mysql)" mysql > mydump.sql

I do encourage you to read a tutorial about it though. The MySQL parameters of YunoHost are standard.

thanks, I’d try this :

mysqldump -uroot "$(sudo cat /etc/yunohost/mysql)" --single-transaction --default-character-set=utf8 --events --ignore-table=mysql.event --all-databases > /tmp/all_databases_backup.sql

I’m not sure but I read it was important to backup on utf-8 if you’re datas are in this format, and it seem to be

I want to backup the server and restore it on the freshly installed yunohost server.
Most important application which are to backed and restored are:

  1. All the accounts
  2. Emails
  3. Baikal
  4. Jappix(including saved chat history and profiles)
  5. Zerobin

How can I backup and restore them?

For emails and accounts you can use sudo yunohost backup create
For the apps I don’t know, but if someone knows I’m interested.

1 Like

I am getting the error with the command sudo yunohost backup create

Traceback (most recent call last):
File “/usr/bin/yunohost”, line 160, in
print_json=PRINT_JSON, use_cache=USE_CACHE)
File “/usr/lib/python2.7/dist-packages/moulinette/”, line 117, in cli, print_json)
File “/usr/lib/python2.7/dist-packages/moulinette/interfaces/”, line 202, in run
ret = self.actionsmap.process(args, timeout=5)
File “/usr/lib/python2.7/dist-packages/moulinette/”, line 462, in process
return func(**arguments)
File “/usr/lib/moulinette/yunohost/”, line 68, in backup_create
if name in backup_list()[‘archives’]:
File “/usr/lib/moulinette/yunohost/”, line 302, in backup_list“unable to iterate over local archives: %s”, str(e))
NameError: global name ‘logging’ is not defined