transfer homeassistant configuration between two servers - HelloMorningStar/HomeAssistant GitHub Wiki

1,从本地服务器拷贝配置文件到目标服务器
sudo scp ~/.homeassistant/*.* dist_usr_name@dist_server_ip:~/.homeassistant/

2,在目标服务器执行
hass --open-ui

以上没有复制~/.homeassistant/下的目录,只复制了文件,打开网页会发现在网页中修改的名称没有转移过来。

3,把deps目录复制过来
sudo scp -r ~/.homeassistant/deps dist_usr_name@dist_server_ip:/your_path/dir
复制deps目录后还是无效,所以迁移时只需要复制~/.homeassistant/目录下的文件,另外两个文件夹/deps和/tts无需复制。

4,那么基于网页修改的配置保存在哪里呢?
参考: homeassistant官网文档
https://www.home-assistant.io/docs/authentication/

Migrating to a new system

If you want to migrate your configuration to a new system then you can copy the contents of your configuration folder from the current system to the new system. Be aware that some of the files you need start with ., which is hidden by default from both ls (in SSH), in Windows Explorer, and macOS Finder. You’ll need to ensure that you’re viewing all files before you copy them.

5,干嘛要迁移呢?目前没有必要,作为服务一台一直开着好了:)
人老了,容易忘记,记下来吧:
screen
回车
cd /opt/hass
source bin/activate
sudo hass --open-ui
可以关闭终端去喝咖啡了
以下是screen常用命令
screen -r
screen -list
ctrl + a
d 退出screen
k 杀死screen
-S <作业名称>  指定screen作业的名称

6,实际测试home assistant bridge可以在服务器之间转移,非常方便。

ls -sh filename command for get the file details
mv filename1 filename2 command for change filename1 to filename2

⚠️ **GitHub.com Fallback** ⚠️