Technical tools ·
Automatic Backups to a Folder, FTP or Dropbox, with Easy Restore
A failing disk or a serious mistake should never cost you your data. The Backup app in ERPSqlite makes automatic copies of the database, stores them wherever you choose and lets you go back to any day in one click. This guide shows how to set it up, how to restore and what to keep an eye on.

Features
- Destination: a folder (local, network or synced), an FTP server or Dropbox.
- Scheduling: how often the backup runs and at what time.
- Retention: how many backups are kept (the oldest ones are deleted).
- An extra copy in a Documents folder.
- Download a backup and import one from your computer.
- Restore into the current database (saving a backup of it first) or into a new database.
- Works with SQLite, PostgreSQL and MySQL databases: the backup is always a compressed SQLite file.

Screens and views
Backups is the main screen. At the top it shows the “Destination”, whether it is “Scheduled” (with the date of the next run) and the “Last backup”. Below are the “Available backups”, with date, name and size, and the “History” of backups and restores. The “Back up now”, “Refresh” and “Import backup…” buttons are always at hand.
Configuration, for administrators only, gathers the destination, the FTP or Dropbox details, the schedule, “Keep the last” and “Copy in Documents”, along with the “Test connection” button.

How to set it up
- Open Backup → Configuration and choose the destination.
- Tick “Back up automatically” and set “Every” (hours, days, weeks or months), “At (HH:MM)” and how many backups to keep.
- Test the destination with “Test connection” and make a first backup with “Back up now”.
- Check the list of backups and its entry in the “History”.

Connecting Dropbox
- Choose Dropbox as the destination and enter the “App key” and “App secret” of your Dropbox app.
- Click “Connect to Dropbox”: the Dropbox page opens so you can authorize access.
- Copy the code Dropbox shows you and paste it where it says “Paste the code Dropbox gave you”.
- Enter the “Dropbox folder” and save. The ERP renews access on its own, without asking for the code again.

How the backup is made
With a SQLite database, the ERP uses VACUUM INTO, which creates a consistent copy even while people are working. With PostgreSQL or MySQL, it copies the data table by table into a SQLite file. Either way, it compresses the file with gzip and names it with the date and time (…-YYYYMMDD-HHMMSS.sqlite.gz).
The schedule is one of the ERP's scheduled actions — the same one you can see under Settings → Scheduled actions. After each backup, any copies beyond the retention limit (30 by default) are deleted from the destination.


Restoring
Pick the backup from the day you want and restore it “In this database” or “In a new database…” to look at it without touching the current one. Before restoring into the current database, the ERP saves a copy of it just in case, with “antes-de-restaurar” (“before restore”) in the file name.
If the backup comes from an older version of the ERP, the schema updates are applied when it is opened. Backup settings are preserved after a restore, so the schedule keeps running.

A worked example
A store schedules a daily backup at 11:00 PM to a folder on its NAS, keeps the last 30 and turns on the copy in Documents. One Tuesday it discovers that several product records were deleted by mistake on Monday.
The administrator restores Sunday's backup “In a new database…”, opens it, checks the data and decides: either copy the lost records back by hand or restore into the current database, knowing that a copy of the current state will be saved first.

Security and common mistakes
- Backups are compressed, not encrypted: store them in a destination with restricted access.
- The backup FTP connection is not encrypted: use it on trusted networks or prefer a folder or Dropbox.
- A backup on the same disk will not survive a disk failure: use an external destination and, on top of that, Documents.
- Don't trust a backup you haven't tested: every so often, restore one into a new database to make sure it is sound.
- Downloading, importing and restoring are reserved for administrators; other users can see the list.

Frequently asked questions
Where can I store the backups?
In a local or network folder, on an FTP server or in Dropbox — plus an extra copy in Documents.
Does it work with PostgreSQL or MySQL?
Yes. The backup of a server database is also a SQLite file, which can be restored to the server or opened as a local database.
Do I lose the current database when I restore?
No: a backup of the current database is saved first. You can also restore into a new database.
How often can backups be scheduled?
Every given number of hours, days, weeks or months, at the time you set in “At (HH:MM)”.
What format is the backup saved in?
As a .sqlite.gz file: a SQLite database compressed with gzip. Uncompressed .sqlite files are also accepted on import.
Can I restore a backup made on another computer?
Yes. With “Import backup…” you choose the file and restore it into this database or a new one.