Moving HA-Core from old to new PC

Hello.

I have HA-Core 2023.1.7 running on my “old-PC”.
Now i want to move HA to a new PC.
For that i installed Debian11 and HA-Core, HACS, Cockpit and updated Python to 3.10.12.
HA is running now on the new System.

First question: Why does HA says, There is Python 3.9.2 even i just updated it to 3.10.12 ?
Screenshot (46)
How can i fix this?

Second Question: Can i copy all the files like configruation.yaml, the folders and so on from old system to new system? Do i have take care of something special?

or

Third Question: are in the ha-backup also all integrations,frontends,automations included? Or do i have to reinstall them by hand?

Fourth Question: in HACS i can install Frontends, Automations but NOT Integrations!
When trying any Integration, the circle keeps on turning forever!
Screenshot (47)
How can i fix this?

Thank you for helping…
Wolfram.

Why install Debian old-stable, and not the current stable version - Debian Bookworm, which has already Python 11 ?

Yes, make sure you copy the hidden files/folders as well

Some more people have seen this recently.

Well, first i installed Debian 12 but HA didnt install right, some errors.
So i took Debian 11. Later i can dist-upgrade…

But why does HA do not see Python 3.10 and shows 3.9.x?

and one more thing i find strange:
Even i upgraded HA it shows me: Home Assistant 2023.1.7 Frontend 20230110.0 - latest

Shouldnt be there a higher Version of HA?

Because the venv was built with that version. You need to re-create the venv with the new version.

Also, you need Python 3.11(.5) now :wink:

Yes, or restore the backups you’re hopefully taking.

Yes, they are.

Check your log file.

OK, i just upgraded to Debian12. It also update Python3 to 3.11.2.
You need to re-create the venv with the new version.
what is venv and how do i recreate this?

When i try to start HA it shows me a error:

root@I3-Server:~# systemctl status home-assistant@homeassistant
● [email protected] - Home Assistant
     Loaded: loaded (/etc/systemd/system/[email protected]; enabled; preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Wed 2023-08-30 13:55:02 CEST; 4s ago
    Process: 1243 ExecStart=/usr/local/bin/hass -c /home/homeassistant/.homeassistant (code=exited, status=1/FAILURE)
   Main PID: 1243 (code=exited, status=1/FAILURE)
        CPU: 32ms

I checked the path of HA with wheris hass and put it into /etc/systemd/system/[email protected]:

[Unit]
Description=Home Assistant
After=network-online.target

[Service]
Type=simple
User=%i
WorkingDirectory=/home/%i/.homeassistant
ExecStart=/usr/local/bin/hass -c "/home/%i/.homeassistant"
RestartForceExitStatus=100
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

I also tried with
ExecStart=/srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant (code=exited, status=1/FAILURE)

EDIT:
This is what Cockpit shows me about failure of HA:

hass
ModuleNotFoundError: No module named 'homeassistant'

PRIORITY
    6
SYSLOG_FACILITY
    3
SYSLOG_IDENTIFIER
    hass
_BOOT_ID
    e80d024dba4745dfb37d8975052f9b46
_CAP_EFFECTIVE
    0
_CMDLINE
    /srv/homeassistant/bin/python3 /srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant
_COMM
    hass
_EXE
    /usr/bin/python3.11
_GID
    998
_HOSTNAME
    I3-Server
_MACHINE_ID
    4cbfb44566e742a4bf29e279400a7220
_PID
    1154
_RUNTIME_SCOPE
    system
_SELINUX_CONTEXT
    unconfined 
_STREAM_ID
    f0e792c9c4f3478383003d0207723b8f
_SYSTEMD_CGROUP
    /system.slice/system-home\x2dassistant.slice/[email protected]
_SYSTEMD_INVOCATION_ID
    0cc109108e404a5786384d8155d4ec15
_SYSTEMD_SLICE
    system-home\x2dassistant.slice
_SYSTEMD_UNIT
    [email protected]
_TRANSPORT
    stdout
_UID
    998
__CURSOR
    s=c7242f083ba84a448d0aa43bb4a5bedd;i=6aba;b=e80d024dba4745dfb37d8975052f9b46;m=636b106;t=60422f5d8a841;x=21b639eb7ac7080f
__MONOTONIC_TIMESTAMP
    104247558
__REALTIME_TIMESTAMP
    1693398060279873

What now?

ok, i got it running again following this threat:

Now i also have the newest Version: Home Assistant 2023.8.4 :slight_smile:

So far so good…

Trying HACS Integration…
…still only turning circle :frowning:

So 3 of 4 Problems are solved.
Where do i find the logfile of HACS?

EDIT: found it.

there is something:

2023-08-30 14:41:05.844 ERROR (MainThread) [custom_components.hacs] <Integration custom-components/ble_monitor> Download was not completed [[Errno 13] Permission denied: '/home/homeassistant/.homeassistant/custom_components/ble_monitor']

so i typed chmod -R 777 /home and now HACS Integrations Downloads working!

Next step is to restore the backup…

said for HA not to have a Restore-Function for backups except before boarding… :frowning:

Only HAOS has a restore option, and you’re not using it.

That’s not a good thread to follow. Using a venv is the only recommended way when you use pip.

By skipping the venv you’re at risk of breaking your HA install if you install any other Python program.

HAOS is no option for me (not yet) because some other Software is running on that PC like Motion-Eye, Cockpit and some small tools.

BTW: the “Using a venv” describes exactly the way i did, so everything should be fine now.
After some Integrations-Update with HACS the new System is running well!
Everything is back there. Time to make a Disk-Backup…

I thank all for the help!

Do keep in mind that when Python 3.12 is released you’ll need to install that and rebuild the venv with 3.12. Then again for 3.13, 3.14, etc.

Alternatively, use Docker and those problems go away.