For importing TeslaFi data into your GCP TeslaMate instance...
After ensuring that TeslaMate and Grafana are working correctly with live data, SSH into your instance and shut them down using
Then in TeslaFi go to Settings > Account and scroll down to Download TeslaFi Data and you will then need to download the data month by month - you will get a .csv file for each.
You then need to get the files into your GCP instance - I believe there are other ways which may be more efficient but since I only had 7 files to worry about I just uploaded them using the SSH browser window. To do so just click the cog in the top right, select "Upload file" and select each of the .csv files in turn (unfortunately you can only do them one at a time this way). These files will be put into your home directory. You then need to move them into the import directory which should already exist.
Code:
sudo mv *.csv import/
ls import/
That should move the files and then list the contents of the import directory to ensure they are there.
With the files in place it is now time to restart the teslamate service, but since the micro machine type seems to struggle with the import process I would recommend temporarily upgrading to a "small" machine type. To do so go to your GCP console, from the Navigation window go to the Compute Engine>VM instances page (if you are not already on it) and click on the name of your instance. You can then click on the "STOP" entry at the top of the page, acknowledge any warning and then once it has stopped click on "EDIT" and change the Machine type to "g1-small", Save and then click "START". With the instance back up and running you can reconnect your SSH browser window and restart Teslamate.
Code:
sudo docker-compose up -d
Allow a couple of minutes for it to get going and then go to your teslamate.domain.com address where you should be greeted with a list of your import files. Just ensure the timezone is correct then click Import and grab a cup of tea. If all is well the files should gradually one by one get a green tick by them. Once they all have green ticks go to your SSH window and enter:
Code:
cd import
sudo rm *.csv
cd ..
docker-compose down
Once all the services are confirmed down, go back to the GCP console and just do the reverse of earlier - Stop, edit the machine type back to micro, then Start again, reconnect the SSH window and one final
Code:
sudo docker-compose up -d
After a few minutes you should then be able to view all your historic TeslaFi data in TeslaMate/Grafana.