I tested to restore a backup from one YunoHost machine on a other machine. This will not work, because it seems that the same “domain name” must be registerer on the machine that restores the app:
Traceback (most recent call last):
File "/usr/lib/moulinette/yunohost/backup.py", line 1452, in _restore_app
sync_perm=False,
File "/usr/lib/moulinette/yunohost/log.py", line 380, in func_wrapper
result = func(*args, **kwargs)
File "/usr/lib/moulinette/yunohost/permission.py", line 465, in permission_create
sync_perm=False,
File "/usr/lib/moulinette/yunohost/log.py", line 380, in func_wrapper
result = func(*args, **kwargs)
File "/usr/lib/moulinette/yunohost/permission.py", line 531, in permission_url
url = _validate_and_sanitize_permission_url(url, app_main_path, app)
File "/usr/lib/moulinette/yunohost/permission.py", line 937, in _validate_and_sanitize_permission_url
_assert_no_conflicting_apps(domain, path, ignore_app=app)
File "/usr/lib/moulinette/yunohost/app.py", line 3104, in _assert_no_conflicting_apps
conflicts = _get_conflicting_apps(domain, path, ignore_app)
File "/usr/lib/moulinette/yunohost/app.py", line 3080, in _get_conflicting_apps
raise YunohostValidationError("domain_name_unknown", domain=domain)
That’s boring
I downloaded the backup file and copied on the destination machine via ssh…
Next try: I just add the “missing” Domain name and start a restore again that failed:
Traceback (most recent call last):
File "/usr/lib/moulinette/yunohost/backup.py", line 1452, in _restore_app
sync_perm=False,
File "/usr/lib/moulinette/yunohost/log.py", line 380, in func_wrapper
result = func(*args, **kwargs)
File "/usr/lib/moulinette/yunohost/permission.py", line 412, in permission_create
raise YunohostValidationError("permission_already_exist", permission=permission)
yunohost.utils.error.YunohostValidationError: Berechtigung 'pyinventory.main' existiert bereits
Note the app was installes before… Then i have uninstall it and then try to restore the backup from the other machine…
You should add the domain to yunohost (even if you don’t have it), the app you want to restore must be uninstalled before proceeding. Yunohost must be up to date. Proceed with the restoration and then change the domain of the app to the new one.
jens@rpi:~ $ sudo yunohost tools shell
Warning: The ldap interface is available in this context
Warning: You don't have IPython installed, consider installing it as it is way better than the standard shell.
Warning: Falling back on the standard shell.
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>
KeyboardInterrupt
>>> from yunohost.permission import permission_delete
>>> permission_delete("pyinventory.main")
Traceback (most recent call last):
File "/usr/lib/moulinette/yunohost/tools.py", line 743, in tools_shell
from IPython import embed
ModuleNotFoundError: No module named 'IPython'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/lib/moulinette/yunohost/log.py", line 380, in func_wrapper
result = func(*args, **kwargs)
File "/usr/lib/moulinette/yunohost/permission.py", line 615, in permission_delete
raise YunohostValidationError("permission_cannot_remove_main")
yunohost.utils.error.YunohostValidationError: Removing a main permission is not allowed
>>>
EDIT: I run system upgrade… e.g.: Yunohost v4.2.7 → 4.2.8.3 … The i will retry the remove commands…