Giter VIP home page Giter VIP logo

Comments (9)

denisjoshua avatar denisjoshua commented on July 24, 2024

Now I have another error:

root@docker:/bkp/docker/teslamate# docker compose exec -T database psql -U usr4tesla 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)))::public.earth';
.
NOTICE:  drop cascades to 2 other objects
DETAIL:  drop cascades to extension cube
drop cascades to extension earthdistance
DROP SCHEMA
CREATE SCHEMA
CREATE EXTENSION
CREATE EXTENSION
**ERROR:  function radians() does not exist**
LINE 6: ...c.cube(public.cube(public.cube(public.earth()*cos(radians())...
                                                             ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

Thanks again
Denis

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on July 24, 2024

Hello,

thanks for reporting.

Please help us understand what your installation looks like and what you want to archive.

v1241

This Version does not exist.

Overall it looks for me that your try to restore following https://docs.teslamate.org/docs/maintenance/backup_restore#restore and do have copy paste issues.

from teslamate.

denisjoshua avatar denisjoshua commented on July 24, 2024

Sorry... I didn't know the version of TeslaMate
Now I see it... is 1.29.2.

Yes... I try to restore the DB from a server to another.
But I want to ask something... is there possibility to backup the docker and put it on another server ?
Like usually dockers can do...

Thanks again
Denis

from teslamate.

denisjoshua avatar denisjoshua commented on July 24, 2024

I want to ask another think please ...

Here it give me an error:

root@docker:/bkp/docker/teslamate# docker compose exec -T database psql -U usr4tesla teslamate << .
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)))::public.earth';
.
ERROR:  function radians() does not exist
LINE 6: ...c.cube(public.cube(public.cube(public.earth()*cos(radians())...
                                                             ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

But if I connect to pgsql and I send the \df command, I can see the "ll_to_earth" function.
So it was created even if it gave an error please ?

Thanks again
Denis
Thanks again

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on July 24, 2024

is there possibility to backup the docker and put it on another server ?

Docker handles the volumes on its own. You can copy the volume, but when trying to use it on another machine it will fail. You can declare it as external, but this will break other things. Therefore, not recommended way in any project I am aware of.

I try to restore the DB from a server to another.

It is like

  1. Backup on old system
  2. Install TeslaMate on new system
  3. Restore data on new system.

I would suggest you start with a clean system, to have a clear and defined state. You can run a docker volume ls on new system to see the teslamate-db volume, then a docker compose down to then let you delete the database volume with docker volume rm xyz

Then you can follow above instructions.

usr4tesla

Did you change the TM_DB_USER

from teslamate.

denisjoshua avatar denisjoshua commented on July 24, 2024

Thanks a lot for your help... but I finally understand why I had some errors...
I had the docker compose file compiled with postgres version 13... :-(
I put version 16 and remake all from the begining and now it's all ok.

The problem that I have now is that I can't import 2 month of data from Teslafi...
I do all the procedure and I run it from web... here is the log:

2024-07-03 22:47:59.295 [notice] SIGTERM received - shutting down
2024-07-03 22:47:59.295 [info] Shutting down 2 sockets in 1 rounds of 2000ms
waiting for postgres at 127.0.0.1:5432
[info] Found 2 file(s) at '/opt/app/import'. Starting in import mode!
2024-07-03 22:48:02.333 [info] Migrations already up
[info] Found 2 file(s) at '/opt/app/import'. Starting in import mode!
2024-07-03 22:48:03.563 [info] System Info: Erlang/OTP 26 (jit)
2024-07-03 22:48:03.563 [info] Version: 1.29.2
2024-07-03 22:48:04.188 [info] POST https://auth.tesla.com/oauth2/v3/token -> 200 (614.534 ms)
2024-07-03 22:48:04.188 [info] Refreshed api tokens
2024-07-03 22:48:04.200 [info] Scheduling token refresh in 6 h
2024-07-03 22:48:04.204 [info] Running TeslaMateWeb.Endpoint with cowboy 2.10.0 at :::4000 (http)
2024-07-03 22:48:04.204 [info] Access TeslaMateWeb.Endpoint at http://localhost
2024-07-03 22:48:04.396 [info] GET /
2024-07-03 22:48:04.397 [info] Sent 302 in 1ms
2024-07-03 22:48:04.400 [info] GET /import
2024-07-03 22:48:04.402 [info] Sent 200 in 1ms
2024-07-03 22:48:42.987 [info] Importing 2 file(s) ...
2024-07-03 22:48:42.990 [info] Starting logger for 'Tesa'
2024-07-03 22:48:43.092 [info] Import complete!

But when I connect to the pgsql and I made a select of data from that month I receive nothing:

teslamate=# select * from drives where start_date between '2024-04-01' and '2024-05-31' order by start_date;
 id | start_date | end_date | outside_temp_avg | speed_max | power_max | power_min | start_ideal_range_km | end_ideal_range_km | start_km | end_km | distance | duration_min | car_id | inside_temp_avg | start_address_id | end_address_id | start_rated_range_km | end_rated_range_km | start_position_id | end_position_id | start_geofence_id | end_geofence_id 
----+------------+----------+------------------+-----------+-----------+-----------+----------------------+--------------------+----------+--------+----------+--------------+--------+-----------------+------------------+----------------+----------------------+--------------------+-------------------+-----------------+-------------------+-----------------
(0 rows)

Have you some ideea please ?
Thanks a lot again
Denis

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on July 24, 2024

now it's all ok.

Great to hear.

Have you some ideea please ?

Your query looks good and returns the correct entries on my side. I assume either a csv file error or a corrupt file.

from teslamate.

denisjoshua avatar denisjoshua commented on July 24, 2024

I just download the csv files from TelaFi and make all steps here
Do you know if TeslaFi import is still work please ?
Thanks again
Denis

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on July 24, 2024

Do you know if TeslaFi import is still work please ?

For sure, see comments in #3431

from teslamate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.