Got it
What happens when you run the restore commands? As if you are running from the home folder that you land in from the Pi, it should be able to find it?
Worst case I’ll help you out via zoom this week, so don’t worry too much
Got it
What happens when you run the restore commands? As if you are running from the home folder that you land in from the Pi, it should be able to find it?
Worst case I’ll help you out via zoom this week, so don’t worry too much
That would be awesome Dave - Appreciate it
So when i run the restore command - this is what terminal shows:
pi@raspberrypi:~ $ # Stop the teslamate container to avoid write conflicts
pi@raspberrypi:~ $ docker-compose stop teslamate
create schema public;
create extension cube;
create extension earthdistance;
CREATE OR REPLACE FUNCTION public.ll_to_earth(float8, float8)
RETURNS public.earth
LANGUAGE SQL
IMMUTABLE STRICT
PARALLEL SAFE
AS 'SELECT public.cube(public.cube(public.cube(public.earth()*cos(radians(\$1))*cos(radians(\$2))),public.earth()*cos(radians(\$1))*sin(radians(\$2))),public.earth()*sin(radians(\$1))):
ublic.earth';
.
# Restore
docker-compose exec -T database psql -U teslamate -d teslamate < teslamate.bck
# Restart the teslamate container
Stopping pi_teslamate_1 ... done
pi@raspberrypi:~ $
pi@raspberrypi:~ $ # Drop existing data and reinitialize
pi@raspberrypi:~ $ docker-compose exec -T database psql -U teslamate << .
> drop schema public cascade;
> create schema public;
> create extension cube;
> create extension earthdistance;
> CREATE OR REPLACE FUNCTION public.ll_to_earth(float8, float8)
> RETURNS public.earth
> LANGUAGE SQL
> IMMUTABLE STRICT
> PARALLEL SAFE
> AS 'SELECT public.cube(public.cube(public.cube(public.earth()*cos(radians(\$1))*cos(radians(\$2))),public.earth()*cos(radians(\$1))*sin(radians(\$2))),public.earth()*sin(radians(\$1))):
ublic.earth';
> .
NOTICE: drop cascades to 23 other objects
DETAIL: drop cascades to extension cube
drop cascades to extension earthdistance
drop cascades to table schema_migrations
drop cascades to table cars
drop cascades to table drives
drop cascades to table positions
drop cascades to type states_status
drop cascades to table states
drop cascades to table charging_processes
drop cascades to table charges
drop cascades to table updates
drop cascades to table addresses
drop cascades to table tokens
drop cascades to table settings
drop cascades to type unit_of_length
drop cascades to type unit_of_temperature
drop cascades to table geofences
drop cascades to function convert_m(double precision,text)
drop cascades to type range
drop cascades to table car_settings
drop cascades to type billing_type
drop cascades to function convert_km(numeric,text)
drop cascades to function convert_celsius(numeric,text)
DROP SCHEMA
CREATE SCHEMA
CREATE EXTENSION
CREATE EXTENSION
CREATE FUNCTION
pi@raspberrypi:~ $
pi@raspberrypi:~ $ # Restore
pi@raspberrypi:~ $ docker-compose exec -T database psql -U teslamate -d teslamate < teslamate.bck
-bash: teslamate.bck: No such file or directory
pi@raspberrypi:~ $
pi@raspberrypi:~ $ # Restart the teslamate container
pi@raspberrypi:~ $ docker-compose start teslamate
Starting teslamate ... done
pi@raspberrypi:~ $ pi@raspberrypi:~ $ # Stop the teslamate container to avoid write conflicts
# Restart the teslamate container
Stopping pi_teslamate_1 ... done
pi@raspberrypi:~ $
pi@raspberrypi:~ $ # Drop existing data and reinitialize
pi@raspberrypi:~ $ docker-compose exec -T database psql -U teslamate << .
> drop schema public cascade;
> create schema public;
> create extension cube;
> create extension earthdistance;
> CREATE OR REPLACE FUNCTION public.ll_to_earth(float8, float8)
> RETURNS public.earth
> LANGUAGE SQL
> IMMUTABLE STRICT
> PARALLEL SAFE
> AS 'SELECT public.cube(public.cube(public.cube(public.earth()*cos(radians(\$1))*cos(radians(\$2))),public.earth()*cos(radians(\$1))*sin(radians(\$2))),public.earth()*sin(radians(\$-bash: pi@raspberrypi:~: command not found
1))):
ublic.earth';
> .
NOTICE: drop cascades to 23 other objects
DETAIL: drop cascades to extension cube
drop cascades to extension earthdistance
drop cascades to table schema_migrations
drop cascades to table cars
drop cascades to table drives
drop cascades to table positions
drop cascades to type states_status
drop cascades to table states
drop cascades to table charging_processes
drop cascades to table charges
drop cascades to table updates
drop cascades to table addresses
drop cascades to table tokens
drop cascades to table settings
drop cascades to type unit_of_length
drop cascades to type unit_of_temperature
drop cascades to table geofences
drop cascades to function convert_m(double precision,text)
drop cascades to type range
drop cascades to table car_settings
drop cascades to type billing_type
drop cascades to function convert_km(numeric,text)
drop cascades to function convert_celsius(numeric,text)
DROP SCHEMA
CREATE SCHEMA
CREATE EXTENSION
CREATE EXTENSION
CREATE FUNCTION
pi@raspberrypi:~ $
pi@raspberrypi:~ $ # Restore
pi@raspberrypi:~ $ docker-compose exec -T database psql -U teslamate -d teslamate < teslamate.bck
-bash: teslamate.bck: No such file or directory
pi@raspberrypi:~ $
pi@raspberrypi:~ $ # Restart the teslamate container
pi@raspberrypi:~ $ docker-compose start teslamate
Starting teslamate ... done
pi@raspberrypi:~ $ pi@raspberrypi:~ $ docker-compose stop teslamate
-bash: pi@raspberrypi:~: command not found
pi@raspberrypi:~ $ create schema public;
-bash: create: command not found
pi@raspberrypi:~ $ create extension cube;
-bash: create: command not found
pi@raspberrypi:~ $ create extension earthdistance;
-bash: create: command not found
pi@raspberrypi:~ $ CREATE OR REPLACE FUNCTION public.ll_to_earth(float8, float8)
-bash: syntax error near unexpected token `('
pi@raspberrypi:~ $ RETURNS public.earth
-bash: RETURNS: command not found
pi@raspberrypi:~ $ LANGUAGE SQL
-bash: LANGUAGE: command not found
pi@raspberrypi:~ $ IMMUTABLE STRICT
-bash: IMMUTABLE: command not found
pi@raspberrypi:~ $ PARALLEL SAFE
-bash: PARALLEL: command not found
pi@raspberrypi:~ $ AS 'SELECT public.cube(public.cube(public.cube(public.earth()*cos(radians(\$1))*cos(radians(\$2))),public.earth()*cos(radians(\$1))*sin(radians(\$2))),public.earth()*sin(radians(\$1))):
ublic.earth';
-bash: AS: command not found
pi@raspberrypi:~ $ .
-bash: .: filename argument required
.: usage: . filename [arguments]
pi@raspberrypi:~ $
pi@raspberrypi:~ $ # Restore
pi@raspberrypi:~ $ docker-compose exec -T database psql -U teslamate -d teslamate < teslamate.bck
-bash: teslamate.bck: No such file or directory
pi@raspberrypi:~ $
pi@raspberrypi:~ $ # Restart the teslamate container
pi@raspberrypi:~ $ Stopping pi_teslamate_1 ... done
-bash: Stopping: command not found
pi@raspberrypi:~ $ pi@raspberrypi:~ $
-bash: pi@raspberrypi:~: command not found
pi@raspberrypi:~ $ pi@raspberrypi:~ $ # Drop existing data and reinitialize
-bash: pi@raspberrypi:~: command not found
pi@raspberrypi:~ $ pi@raspberrypi:~ $ docker-compose exec -T database psql -U teslamate << .
> > drop schema public cascade;
> > create schema public;
> > create extension cube;
> > create extension earthdistance;
> > CREATE OR REPLACE FUNCTION public.ll_to_earth(float8, float8)
> > RETURNS public.earth
> > LANGUAGE SQL
> > IMMUTABLE STRICT
> > PARALLEL SAFE
> > AS 'SELECT public.cube(public.cube(public.cube(public.earth()*cos(radians(\$1))*cos(radians(\$2))),public.earth()*cos(radians(\$1))*sin(radians(\$2))),public.earth()*sin(radians(\$1))):
ublic.earth';
> > .
> NOTICE: drop cascades to 23 other objects
> DETAIL: drop cascades to extension cube
> drop cascades to extension earthdistance
> drop cascades to table schema_migrations
> drop cascades to table cars
> drop cascades to table drives
> drop cascades to table positions
> drop cascades to type states_status
> drop cascades to table states
> drop cascades to table charging_processes
> drop cascades to table charges
> drop cascades to table updates
> drop cascades to table addresses
> drop cascades to table tokens
> drop cascades to table settings
> drop cascades to type unit_of_length
> drop cascades to type unit_of_temperature
> drop cascades to table geofences
> drop cascades to function convert_m(double precision,text)
> drop cascades to type range
> drop cascades to table car_settings
> drop cascades to type billing_type
> drop cascades to function convert_km(numeric,text)
> drop cascades to function convert_celsius(numeric,text)
> DROP SCHEMA
> CREATE SCHEMA
> CREATE EXTENSION
> CREATE EXTENSION
> CREATE FUNCTION
> pi@raspberrypi:~ $
> pi@raspberrypi:~ $ # Restore
> pi@raspberrypi:~ $ docker-compose exec -T database psql -U teslamate -d teslamate < teslamate.bck
> -bash: teslamate.bck: No such file or directory
> pi@raspberrypi:~ $
> pi@raspberrypi:~ $ # Restart the teslamate container
> pi@raspberrypi:~ $ docker-compose start teslamate
> Starting teslamate ... done
When i then start Teslamate - Everything is wiped and i have to log in and set up everything again like if it factory restored everything
Its probably something simple im missing but i cant figure out what!