Blame

4cd688 Hargata Softworks 2024-02-09 04:59:13 1
# Postgres
2
5fb3cf Hargata Softworks 2025-10-18 21:36:59 3
For users that desire additional scalability for their backend, LubeLogger supports a PostgreSQL backend.
4cd688 Hargata Softworks 2024-02-09 04:59:13 4
5
## Configuration
6
5fb3cf Hargata Softworks 2025-10-18 21:36:59 7
Add your connection string to the Server Settings Configurator, example:
4cd688 Hargata Softworks 2024-02-09 04:59:13 8
9
```
10
Host=<yourserveraddress:port>;Username=<yourusername>;Password=<yourpassword>;Database=<databasename>;
11
```
12
5fb3cf Hargata Softworks 2025-10-18 21:36:59 13
![](/Advanced/Postgres/a/image-1760823415775.png)
14
4cd688 Hargata Softworks 2024-02-09 04:59:13 15
LubeLogger will then automatically create the tables it needs, all records will then be saved and loaded from Postgres tables from now on.
16
17
## Backups
18
19
Once you have switched over to Postgres, LubeLogger's built in and backup function will only back up images, documents, and the server config. You are responsible for maintaining backups of the DB records.
20
21
## Database Migration
22
91ba3d Hargata Softworks 2024-02-09 22:02:05 23
A tool is provided to ease the migration process between LiteDB and Postgres. This tool can be found at the `/migration` endpoint and is only accessible when a Postgres connection is provided.
24
2b40a9 DESKTOP-T0O5CDB\DESK-555BD 2024-09-20 15:19:12 25
![](/Advanced/Postgres/a/image-1726781283739.png)
d564c4 Hargata Softworks 2024-02-09 22:33:03 26
27
### Importing to Postgres
28
29
To transfer all your existing data from LiteDB to Postgres:
30
1. Create a backup using the "Make Backup" feature in the Settings tab.
31
2. Extract the zip file.
32
3. You should see a folder named "data" in the extracted folder
33
4. Inside the data folder will be a .db file named `cartracker.db`
34
5. Navigate to the Database Migration tool
35
6. Click "Import to Postgres"
36
7. Select the `cartracker.db` file
37
8. Your data will be imported into your Postgres DB, and you may double check that the DB has been imported successfully using a Postgres DB Administration Tool.
38
39
### Exporting from Postgres
40
41
In the event that you need to transfer all your data back onto a LiteDB database file from Postgres, you may do so using the Database Migration tool:
42
1. Navigate to the Database Migration Tool
43
2. Click "Export from Postgres"
44
3. Extract the downloaded zip file and you should find `cartracker.db` in it.
45
4. Create a backup using the "Make Backup" feature in the Settings tab.
46
5. Extract the zip file.
47
6. You should see a folder named "data" in the extracted folder, if not, create it.
48
7. Place `cartracker.db` inside the "data" folder
49
8. Re-zip the extracted folder
50
9. Restore the backup using the "Restore Backup" feature in the Settings tab.
51
10. Make sure you remove the PostgreSQL connection from the environment variables so that all future changes will be saved in LiteDB.