- Prepare local environment
- Install
pgcli
andpgloader
- Install
- Prepare homeassistant environment
- Install
timescaledb
addon (supervisor required) - Configure addon (you have to manually add the listening port in the addons configuration page)
- Install
- Stop homeassistant core with
ha core stop
(when connected via SSH to your homeassistant instance) - Fetch
home-assistant_v2.db
via SCP to your local machine (which you've prepared in step #1) - Execute
pgloader
to migrate SQLite DB to PostgresSQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
REALPATH_PHP_BINARY="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$REALPATH_PHP_BINARY/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Name: realuser.vim | |
" Version: 1.0 | |
" Author: Max Boesing <max@kriegt.es> | |
" Summary: Vim plugin to load users own .vimrc if existent and if the current | |
" user is root | |
if ! exists("g:realuser") | |
let g:realuser=system('w | grep $(ps w | grep ' . getpid() . ' | head -n1 | awk "{ print \$2 }") | awk "{ print \$1 }"') | |
if $USER == 'root' | |
let g:vimrc=system('printf /home/%s/.vimrc '. g:realuser) | |
if filereadable(g:vimrc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<root> | |
<devicevendordef> | |
<vendorname>Apple_Internal_Keyboard_Vendor</vendorname> | |
<vendorid>0x05ac</vendorid> | |
</devicevendordef> | |
<deviceproductdef> | |
<productname>Apple_Internal_Keyboard_Product</productname> | |
<productid>0x0273</productid> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
root /var/www/oxid; | |
index index.php index.html; | |
server_name oxid.tld; |