What is the recommended way to backup or export Loki data

I have a loki setup and all logs are available in Loki, i wanted to know the recommended way to take backup or export the data and store it outside of Loki.

You can write a python or small go app that does the API call and export logs in some interval, shouldn’t be too hard to do. If you are using some sort of object storage like S3 you can leverage the replication feature and replicate the entire bucket to another region as backup.