← All Articles

Exporting and Backing Up Workspace Data

administration beginner data-export backup chat-history administration compliance

SecureAI stores conversations, uploaded documents, knowledge bases, user settings, and system configuration within your workspace. This guide covers how to export each type of data, set up regular backups, and restore from backups when needed.

What Data Can Be Exported

SecureAI workspaces contain several categories of data. Each has its own export method and format.

Data Type Export Format Who Can Export
Chat history Markdown, PDF, Plain Text, JSON Individual users (own chats), Admins (all chats)
Knowledge bases Original uploaded files Users (own), Admins (all)
User accounts CSV, JSON Admins only
System configuration JSON Admins only
Audit logs CSV, JSON Admins only
Assistants JSON (includes system prompts, settings) Users (own), Admins (all)

Exporting Chat History

Exporting a Single Conversation

  1. Open the conversation you want to export.
  2. Click the three-dot menu in the upper-right corner of the chat.
  3. Select Export.
  4. Choose a format:
    • Markdown -- preserves formatting, code blocks, and structure. Best for archival and re-import.
    • PDF -- printable, read-only format. Best for sharing with stakeholders who do not use SecureAI.
    • Plain Text -- stripped of formatting. Best for feeding into other tools or search indexes.
  5. The file downloads to your browser's default download location.

Exporting All Conversations (Individual User)

Users can export their entire chat history at once:

  1. Click your profile icon in the lower-left corner.
  2. Go to Settings > General > Export.
  3. Click Export All Chats.
  4. SecureAI generates a JSON file containing all your conversations, including timestamps, model selections, and message content.

This export does not include conversations from other users. It includes only conversations owned by the logged-in account.

Bulk Export (Admin)

Administrators can export conversations across all users for compliance, migration, or backup purposes:

  1. Navigate to Admin Panel > Database.
  2. Click Export Chats to download all conversations across the workspace.
  3. The export produces a JSON file with each conversation tagged by user, timestamp, model used, and full message history.

For selective exports, use the Admin Panel > Users page to export chats for specific users or date ranges.

Privacy note: Bulk chat exports may contain sensitive business information (parts pricing, customer details, internal procedures). Handle exported files according to your organization's data handling policies.

Exporting Knowledge Bases

Knowledge bases contain the documents your team uploaded for AI-assisted retrieval.

Exporting Individual Documents

  1. Navigate to Workspace > Knowledge.
  2. Open the knowledge base containing the documents.
  3. Click the download icon next to each document to retrieve the original uploaded file.

SecureAI stores original files alongside the chunked/indexed versions used for retrieval. Downloads return the original file in its uploaded format (PDF, DOCX, TXT, CSV, etc.).

Exporting an Entire Knowledge Base

  1. Open the knowledge base from Workspace > Knowledge.
  2. Click the three-dot menu on the knowledge base card.
  3. Select Export to download all documents as a ZIP archive.

The export includes original files only. It does not include the vector embeddings or chunk metadata -- those are regenerated automatically when documents are re-imported.

Exporting User Accounts

Administrators can export the user directory for auditing or migration:

  1. Go to Admin Panel > Users.
  2. Click Export Users.
  3. Choose CSV or JSON format.

The export includes usernames, email addresses, roles, creation dates, and last login timestamps. It does not include passwords or API keys.

Exporting System Configuration

SecureAI's system configuration -- model connections, default settings, content filters, and integration configurations -- can be exported for backup or replication to another instance.

  1. Navigate to Admin Panel > Settings.
  2. Click Export Settings.
  3. The export produces a JSON file containing all system-level configuration.

What is included:

What is NOT included (for security):

After importing a configuration backup to a new instance, you must re-enter secrets and API keys manually.

Exporting Audit Logs

For compliance documentation and incident investigation:

  1. Go to Admin Panel > Settings > Audit Log.
  2. Set the date range and filters as needed.
  3. Click Export.
  4. Choose CSV (for spreadsheets) or JSON (for programmatic analysis).

Audit log exports include timestamps, user identities, action types, and metadata for each event. See the How to Audit User Activity article for detailed guidance on audit log analysis.

Setting Up Regular Backups

Manual exports work for occasional snapshots, but production deployments should use automated backups.

Database Backups

SecureAI stores data in a SQLite database (single-instance deployments) or PostgreSQL (multi-instance deployments). Back up the database directly for the most complete protection.

SQLite (default single-instance):

The database file is located at the path configured in your deployment. By default:

/app/backend/data/webui.db

Back up this file on a schedule using your preferred backup tool (cron, systemd timer, cloud scheduler):

# Example: daily backup with timestamp
cp /app/backend/data/webui.db /backups/webui-$(date +%Y%m%d).db

PostgreSQL (multi-instance):

# Example: daily pg_dump
pg_dump -h $DB_HOST -U $DB_USER -d secureai > /backups/secureai-$(date +%Y%m%d).sql

File Storage Backups

Uploaded documents and generated files are stored in the data directory:

/app/backend/data/
├── uploads/          # User-uploaded files
├── cache/            # Model and embedding caches (can be regenerated)
└── webui.db          # Database (SQLite deployments)

Back up the entire data/ directory to capture both the database and uploaded files. The cache/ subdirectory can be excluded to save space -- it is regenerated automatically.

Cloud Run Deployments

For SecureAI instances deployed on GCP Cloud Run:

  1. Persistent volume: Ensure your Cloud Run service uses a mounted persistent volume for /app/backend/data/. Without this, data is lost on container restart.
  2. GCS backup: Schedule a Cloud Function or Cloud Scheduler job to copy the data directory to a GCS bucket.
  3. Snapshot schedule: If using Persistent Disk, configure automatic snapshots in the GCP console under Compute Engine > Snapshots > Create Snapshot Schedule.

Backup Frequency Recommendations

Data Type Recommended Frequency Rationale
Database Daily Conversations and settings change frequently
Uploaded files Daily or on-change New documents may be uploaded at any time
System configuration After every change Configuration changes are infrequent but critical
Audit logs Weekly export Supplements database backup with portable format

Backup Verification

Periodically verify that backups are usable:

  1. Restore a backup to a test instance.
  2. Confirm that conversations, knowledge bases, and settings are intact.
  3. Verify user accounts and roles are present.
  4. Check that uploaded documents are accessible.

An untested backup is not a backup.

Restoring from Backup

Restoring the Database

SQLite:

  1. Stop the SecureAI service.
  2. Replace the database file with the backup:
    cp /backups/webui-20260320.db /app/backend/data/webui.db
    
  3. Restart the service.

PostgreSQL:

  1. Stop the SecureAI service.
  2. Restore from the SQL dump:
    psql -h $DB_HOST -U $DB_USER -d secureai < /backups/secureai-20260320.sql
    
  3. Restart the service.

Restoring Uploaded Files

Copy the uploads/ directory from your backup to the data directory:

cp -r /backups/uploads/ /app/backend/data/uploads/

After restoring files, knowledge base indexes will be rebuilt automatically on the next startup.

Restoring System Configuration

  1. Navigate to Admin Panel > Settings.
  2. Click Import Settings.
  3. Select the configuration JSON file.
  4. Re-enter API keys, tokens, and secrets that were excluded from the export.
  5. Test model connections and integrations after import.

Data Retention Considerations

When planning your backup and export strategy, consider:

Troubleshooting

Problem Cause Solution
Export button grayed out Insufficient permissions Contact your admin to verify your role has export privileges
Export file is empty No data in selected range Adjust date filters or check that conversations exist
Database backup fails File locked by running process Use the appropriate backup method for your database (SQLite .backup command or pg_dump for PostgreSQL)
Restored instance missing knowledge base results Vector index not rebuilt Restart the service to trigger automatic re-indexing
Import settings fails Version mismatch Ensure the backup was taken from a compatible SecureAI version