This is a simple tutorial to update your umami stat system when deployed on a Heroku free plan, and it’s complementary to my other post: Backing up umami database on Heroku free plan

Also because first thing I suggest, is to make a backup of the current database as explained in the post above. Then you have to login in the Heroku CLI:

Home@iMac ~ % heroku login

And clone the app to your local disk:

Home@iMac ~ % heroku git:clone -a blog-stats
Cloning into 'blog-stats'...
remote: Counting objects: 7721, done.
remote: Compressing objects: 100% (2232/2232), done.
remote: Total 7721 (delta 5304), reused 7721 (delta 5304)
Receiving objects: 100% (7721/7721), 3.60 MiB | 3.33 MiB/s, done.
Resolving deltas: 100% (5304/5304), done.

Then change directory to “your app name” and set the git remote url of umami:

Home@iMac ~ % cd blog-stats 

Home@iMac blog-stats % git init
Reinitialized existing Git repository in /Users/Home/blog-stats/.git/

Home@iMac blog-stats % heroku git:remote -a blog-stats
set git remote heroku to https://git.heroku.com/blog-stats.git

Home@iMac blog-stats % git remote add origin https://github.com/mikecao/umami.git

Home@iMac blog-stats % git pull origin master
remote: Enumerating objects: 7721, done.
remote: Counting objects: 100% (556/556), done.
remote: Compressing objects: 100% (326/326), done.
remote: Total 7721 (delta 316), reused 383 (delta 226), pack-reused 7165
Receiving objects: 100% (7721/7721), 3.60 MiB | 2.66 MiB/s, done.
Resolving deltas: 100% (5304/5304), done.
From https://github.com/mikecao/umami
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master

Home@iMac blog-stats % git add .   

Then I encountered this error (only the first time)

Home@iMac blog-stats % git commit -am "pre-heroku" 
Author identity unknown
...etc...

That can be quickly solved by authenticate your email to Heroku

Home@iMac blog-stats % git config --global user.email "your@email.com"

Now you simply have to pull from GitHub the latest sources and -wait for Heroku to- build it:

Home@iMac blog-stats % git push heroku master
Enumerating objects: 7721, done.
Counting objects: 100% (7721/7721), done.
Delta compression using up to 16 threads
Compressing objects: 100% (2232/2232), done.
Writing objects: 100% (7721/7721), 3.60 MiB | 1.50 MiB/s, done.
Total 7721 (delta 5304), reused 7721 (delta 5304), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
....etc...
remote: Verifying deploy... done.
To https://git.heroku.com/blog-stats.git
 * [new branch]      master -> master 

Done. Open your app url were is your umami database, login and see if the version has been updated. In my case was from 1.25.0 to 1.26.0