Any way to backup a database to local automatically with API?

I am looking for a way to automatically backup baserow database via API. But the problems are:

  1. Not self-hosted. So cannot directly backup the underlying PostgreSQL database.
  2. Can create snapshots with API, but cannot download them to local machine.
  3. Can export tables as csv file one by one with API, but inconvenient if database contains a lot of tables

Is there a simple API call to download all tables with data from a database?

Hi @coolmoon,

You can export data from the workspace dropdown (Workspace home - context menu on the workspace name) by selecting “Export data”. That will create a downloadable export of the workspace. However please consider that if you are using Baserow.io you will not be able to import it back at the moment.

Since you were asking about the API, this is the endpoint: https://api.baserow.io/api/redoc/#tag/Workspaces/operation/export_workspace_applications_async.

So the exported data in that way can only be imported back to a self-hosted baserow instance, but not the baserow.io hosted workspace?

So the exported data in that way can only be imported back to a self-hosted baserow instance, but not the baserow.io hosted workspace?

Yes, exactly.

So the “import” function on baserow.io is only for importing workspace from self-hosted instances? Any plan to directly support importing from baserow.io exports in the future?

How about self-hosted instances, can they export/import from themselves or between each other?

Baserow can both export and import and you will be allowed to do that with self-hosted Baserow without any issue. We are just being careful for the time being with any imports done in baserow.io for data integrity and security reasons. It is planned to be supported too but the import logic will need to be made more robust before we allow that.

Let’s say I wanted to roll my own automated daily backup of my own baserow.io data, how would you recommend doing it? I’m not worried about mass restore for now. I just want my data locally for example if I suddenly get locked out of my baserow.io account.
No need to discuss the probability of this happening, this is my practice for all cloud services, I use them for convenience but I want a disaster plan.

I already posted the async endpoint to run the applications export above, so after that you only need the “Get Job” endpoint to get a result for any started task:

Is there any update on the ability to import an exported application on baserow. io? I believe that is one of the most significant challenges in convincing my clients to adopt baserow .io service. The backup data makes no sense if you cannot import it back to baserow. io

There is no change in the ability to do that in a self-service fashion and I don’t think this will be available any time soon.

However, if paid customers need to import data to baserow.io because they are e.g. migrating from self-hosting this is indeed possible, but it is a manual process that we do sometimes for customers.

The problem is that we do not want to self-host baserow but just use baserow.io cloud service. However, the exported backup data from baserow.io is meaningless if it cannot be restored back to baserow.io.

You are aware that baserow.io has history data for tables? In which cases do you want to do a mass restore of the database?

But that history data are still at baserow.io, right? I would like a copy of backup data that can be downloaded to my local machine and restored to baserow.io when necessary.

If that’s you’re requirement, I would suggest a self hosted baserow instance with your own postgres DB. That way you can use database level backups and you have full control.

:warning: Bookmarking this - count me as another user that doesn’t want self-hosting, but who sees local restorable backup as an essential feature. Please implement this basic functionality asap! Thanks all Baserowistas!

1 Like

Hey @ELI, have you checked out the snapshots feature? Also, exporting from SaaS and then importing the data back should work fine. :slightly_smiling_face:

Hey, I am just exploring Baserow and tried out the discussed feature and it works now, at least for local file imports. You can export and import files like csv and just need to map the fields. Everything in the Baserow cloud.

1 Like

Did you use the snapshot function mentioned above? Which API endpoint did you use? I did not find one that can directly download a snapshot to local as backup