Trying to understand where Prometheus store data

Hello,

I have Prometheus configured and running on a raspberry pi 5 as below,

global:
  scrape_interval: 1s
  evaluation_interval: 1s
scrape_configs:
  - job_name: "node"
    static_configs:
      - targets: ["server:9100"]

and starting it as,

/usr/local/bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.retention.time=365d

As you can see I had missed to include --storage.tsdb.path.
Where would be currently Prometheus store the data?

Thanks.

I found that its going to /data folder.

Now If I want to move it to another folder by --storage.tsdb.path=/your/custom/path and restart Prometheus, will existing stuff in /data also get migrated over to /your/custom/path ?

Maybe help

1 Like

I think the data will not be migrated and you will need to manually copy it over to the new location (at least).

1 Like

I did below to migrate the data.

sudo systemctl stop prometheus
sudo rsync -av /data/ /mnt/nas/data/

added flag --storage.tsdb.path=/mnt/nas/data to startup config

sudo systemctl restart prometheus

and all my old data is still available in Prometheus.