Settings and data folder for IT
Where the station app keeps its data on Windows, the settings.json keys it reads, how the database is encrypted, and how to move the station to a new PC.
On this page
This page is for the person who installs and looks after the station PC. It covers the data folder, the settings file, encryption, and moving to a new PC.
The data folder
The station app keeps everything in this folder:
%APPDATA%\Petrol Pump
For a Windows user named meera, that is usually C:\Users\meera\AppData\Roaming\Petrol Pump.
The folder keeps the name it had before the product was renamed PetroKhata. PCs installed before the rename keep their data there, so do not rename it. If the folder had a different name, the app would open an empty one.
Each Windows user has their own %APPDATA%. Always start PetroKhata from the same Windows user account.
What is in it
| Path | What it is |
|---|---|
settings.json |
Settings for this PC, written by hand. See below. |
device\device.db |
The station's database, encrypted. |
device\device.key |
The database key, sealed by Windows. |
device\device.json.sealed |
This PC's registration with the server, sealed by Windows. |
device\backup.json.sealed |
The backup key made from the Owner's passphrase, sealed by Windows. |
device\google.json.sealed |
The Owner's Google connection, sealed by Windows. |
device\ai.json.sealed |
The AI assistant's key, sealed by Windows. |
device\backups\ |
The last 7 daily backups (.pumpbak files). |
device\updates\ |
Update installers downloaded from the Updates screen. |
Uninstalling PetroKhata does not delete this folder. It may hold work that has not reached the server.
settings.json
The app reads settings.json from the data folder when it starts. Restart the app after you change it.
{
"apiBase": "https://server.example.com",
"googleClientId": "1234567890-abc.apps.googleusercontent.com",
"googleClientSecret": "your-client-secret"
}
| Key | What it does | If it is missing |
|---|---|---|
apiBase |
The address of the PetroKhata server. Sign-in, sync, licence keys and updates all use it. | The app uses http://127.0.0.1:8080, a server on the same PC, which is only for development. |
googleClientId |
The Google sign-in client (type "Desktop app") used for Google Drive backups and Google Sheets. | Google Drive and Sheets are off on this PC. |
googleClientSecret |
The secret that goes with googleClientId. |
As above. |
The app reads no other keys. There is no separate setting for updates: the PC gets updates from the server in apiBase.
Each key can also be set with an environment variable, which wins over the file: PUMP_API_URL, PUMP_GOOGLE_CLIENT_ID and PUMP_GOOGLE_CLIENT_SECRET.
If settings.json is not valid JSON, the app ignores the whole file and uses the defaults. Check the commas and quotes after you edit it.
Encryption and the Windows-sealed key
- The database
device.dbis encrypted. A copied or stolen file shows nothing. - Its key is made once on this PC. Windows seals it for the Windows user who runs the app. Only that Windows user, on this PC, can open the database.
- PINs do not unlock the database. PINs only decide who is working on the PC.
- If Windows cannot seal the key, the app does not start. It says This computer cannot protect the database key. Sign in to Windows with a user account and start the app again.
Because the key is tied to this Windows user on this PC, copying the data folder to another PC does not move the data. Use the steps below.
One copy at a time
Only one copy of the app runs on a PC. If you start it again while it is open, the open window comes to the front. Two copies must never use the same database.
Install and updates
- The installer is
PetroKhata-Setup-<version>.exe. It installs for the current Windows user and needs no administrator. It adds a desktop shortcut and a Start menu shortcut called PetroKhata. - Updates install the same way, from Setup → Updates. See Update the station app.
For the full install steps, see Install on Windows.
Move the station to a new PC
The new PC gets its data from the server. The old PC's database file is not copied.
- On the old PC, if it still works, let it sync. The top bar should say Synced with a time, and the This PC card on Today should say Everything is on the server.
- On the old PC, go to Setup → Backup, select Back up now, then Save a copy of the newest backup to a pen drive.
- Install PetroKhata on the new PC. Put the same
settings.jsonin its data folder before you start the app. - Set up the new PC for the same business and station. See First-run setup. Everything the server has comes down to the new PC.
- Add each person who works at the station to the new PC, with their PIN. PINs stay on each PC and do not move. See People, PINs and locking.
- If the old PC broke before it could send all its work, the Owner recovers that work from its backup. See Back up and recover your data.
- The Owner sets the backup passphrase on the new PC, so daily backups start there.
- If the station used Google Drive, the Owner connects it again on the new PC. See Google Drive and Sheets.
Something here does not match your screen, or a step is unclear? Tell us and we will fix the page.