|
| 1 | +--- |
| 2 | +id: backup-system-files |
| 3 | +title: Back up and restore Pioreactor system files |
| 4 | +slug: /backup-system-files |
| 5 | +description: Export and import a Pioreactor’s ~/.pioreactor directory from the Inventory page. |
| 6 | +--- |
| 7 | + |
| 8 | +Each Pioreactor keeps its configuration, calibration data, and persistent state inside `~/.pioreactor`. The Inventory page now lets you export that directory as a zip for safekeeping and import it onto the same unit when you need to restore or clone a setup. |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +## Exporting system files |
| 13 | + |
| 14 | +1. Open the **Inventory** page, find the Pioreactor you want to back up, and click **Manage Pioreactor → Export system files**. |
| 15 | +2. Confirm the export when prompted. The UI downloads a file named `<pioreactor>_dot_pioreactor.zip`. |
| 16 | +3. Store the archive somewhere safe. It contains every file from that unit’s `~/.pioreactor` plus a `pioreactor_export_metadata.json` descriptor (hostname, version, export time). |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | +After you confirm, the browser saves a zip named `<pioreactor>_dot_pioreactor.zip`. |
| 21 | + |
| 22 | +#### Troubleshooting |
| 23 | +- If export is blocked, check whether the unit has the sentinel file `~/.pioreactor/DISALLOW_UI_FILE_SYSTEM`; removing it re-enables downloads. |
| 24 | +- Since the export is over http, you may need to "approve" your browser to download it (check the download tab in your browser). |
| 25 | +- For the leader Pioreactor, it's also exporting the sqlite database. This might take a while for very large databases. |
| 26 | + |
| 27 | +## Importing system files |
| 28 | + |
| 29 | +Use imports when you need to restore a backup, duplicate a Pioreactor after replacing hardware, or bring back calibration data after re-flashing an SD card. |
| 30 | + |
| 31 | +1. On the **Inventory** page, choose **Manage Pioreactor → Import system files**. |
| 32 | +2. Read the warning and confirm. You will be prompted to select a `.zip` generated by the export flow. |
| 33 | +3. Wait for confirmation in the snackbar. The UI shows a spinner while uploading and tells you when the Pioreactor begins rebooting. |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +Important behaviour to note: |
| 38 | + |
| 39 | +- Hostnames must match. The worker compares the archive metadata to the target unit name and rejects mismatches during import. |
| 40 | +- The ZIP is validated to block absolute paths, symlinks, or other unsafe entries before anything is extracted. |
| 41 | +- An automatic backup of the existing `~/.pioreactor` is written to `/tmp/<hostname>_dot_pioreactor_backup_<timestamp>` before any files are replaced. You can manually restore from that folder if you need to undo the import. |
| 42 | +- After the files are moved into place, the worker schedules a reboot so the new configuration takes effect. |
| 43 | +- Imports and exports share the same guard: adding `~/.pioreactor/DISALLOW_UI_FILE_SYSTEM` disables both operations until the file is removed. |
| 44 | + |
| 45 | +## Advanced notes |
| 46 | + |
| 47 | +- For scripted workflows you can hit `/api/units/$broadcast/zipped_dot_pioreactor` to download archives for every worker in one request. The aggregated ZIP namespaces each unit under a folder that matches its hostname. |
| 48 | +- Imports are always per-unit. If you are automating restores, loop over your hosts and POST the zip to `/api/units/<pioreactor>/import_zipped_dot_pioreactor` one at a time. |
| 49 | + |
| 50 | +With these tools you can keep regular snapshots of your cluster, move calibrations between identical builds, or roll back quickly after testing changes. |
0 commit comments