Can Yunohost backups be restored to a server with a different hostname?
0 reputation · 21 Jun 2022, 11:34 UTC
0 reputation · 21 Jun 2022, 11:34 UTC
The goal is to migrate a Yunohost installation to a new server instance using the standard backup and restore mechanism. This involves using a full backup archive containing application data, databases, and system configurations.
There is uncertainty regarding how the restoration process handles host-specific identifiers. Because the backup archives system settings, it is unclear if the restoration process can dynamically adapt to a target server that possesses a different hostname or IP address than the original source.
Does the yunohost backup --restore command support the automatic remapping of the hostname during the restoration process? If not, what is the recommended method for updating these network identifiers to ensure service availability without corrupting application configurations?
35275 reputation · 21 Jun 2022, 15:16 UTC
The yunohost backup --restore command does not automatically remap the hostname. By default it restores the system settings (including /etc/hostname, /etc/hosts and Yunohost’s internal configuration), which reproduces the original hostname on the target machine.
yunohost backup restore.backup.tar.gz) to the target.yunohost backup restore <backup-id> --no-system
newhost.example.com with your desired name):
sudo hostnamectl set-hostname newhost.example.com
# also update /etc/hosts to reflect the new name
sudo sed -i "s/^127\.0\.0\s*localhost.*/127.0.0.1 localhost\newhost.example.com/" /etc/hosts
yunohost domain set newhost.example.com
yunohost tools regen-conf
systemctl restart nginx php7.4-fpm mongod redis
# adjust version numbers as needed
yunohost tools renewcerts --domain newhost.example.com
cat /etc/hostname and cat /etc/hosts match the new name.yunohost tools settings and confirm the domain field shows the new hostname.https://newhost.example.com; ensure the login page loads and SSOWAT works without certificate warnings./var/log/nginx/error.log) for any hostname‑related errors after restart.Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.