HA core running in Docker moving hosts

I have an existing HA core running inside Docker container.
I want to move this container (or recreate) on a different host. So I tar up my existing config folder and moved it to the different host. However, on the new host I doesn’t recognize my login. When I first launch the browser it is asking me to create an account. I am unable to create the account as there is an existing account with the same name.

After backtracking and troubleshooting I found the .storage folder never cleanly tar’ed up as the .storage folder permissions where with root privileges. Assuming that folder is the one that contains the user account information and other local storage that I need to move over.

Are there instructions on how to move/backup a docker environment?

Any help is much appreciated.

Tar prefixed with sudo ? Sudo si before tar ?

Thanks @francisp, I figured it out after some time. However, wanted to make sure I wasn’t missing anything else.

Can I remove home-assistant_v2.db from the tar while doing a backup? What is inside the db? logs? I don’t need to back up those?

Most of the time home-assistant_v2.db gets corrupted while restoring, so you really do not need to backup this.