Data
The project disk
Every project on BitHut has its own disk: a folder at /data that stays when you put a new version online. This page explains how much room it has and how to move data into it from your computer.
How the code finds it
The project gets the variable DATA_DIR with the value /data. Code that builds its file paths from DATA_DIR keeps a SQLite database or uploaded files on the saved disk, for example /data/app.db. Your AI writes the code this way when it knows the project runs on BitHut.
How much room there is
Disk space belongs to your plan, not to one project. All your projects share it, and each takes what it needs.
| Plan | Disk for all projects |
|---|---|
| Start | 5 GB |
| Plus | 20 GB |
| Pro | 50 GB |
| Max | 100 GB |
A Postgres database also takes its room from this disk. The cabinet shows the disk in use on each project’s page and for your plan. When your projects already keep all the disk of the plan, BitHut does not start a new project and says so; running projects are not affected. See Plans and billing.
Moving data from your computer
When a project moves to BitHut from your computer or another hosting, its saved data can come with it: a SQLite file, a folder of uploads.
- Deploy the project first, so it has a disk. If it must not run yet, ask your AI to pause it before the deploy.
- Stop the program where it runs now. A database copied while the program writes to it can be broken.
- Ask your AI to send the data to BitHut. The AI gets a one-time command from BitHut and runs it in the folder that holds the file. The command works once, within 30 minutes.
- BitHut keeps a copy of the data that was there before, stops the project for the moment of the swap, puts the new data in place and starts the project again.
- You see what arrived: the files, their size, and whether each SQLite file passed a check.
If a SQLite file fails the check, it was most likely copied while the program wrote to it. Stop the program and send it again.
Limits
- One upload can be up to 500 MB. Bigger data goes in parts, one folder at a time.
- If the data does not fit in the free disk of your plan, nothing changes and BitHut says so.
- The copy of the data from before the upload stays in the restore points. See Backups and restore.
For your AI: get_data_upload_command.