SQLite to PostgreSQL Migration
Migrate your Gauzy database from SQLite to PostgreSQL for production.
Why Migrate?
| Feature | SQLite | PostgreSQL |
|---|---|---|
| Concurrency | Single write | Multi-user |
| Performance | Small datasets | Large datasets |
| Scalability | Limited | Highly scalable |
| Features | Basic | Full SQL support |
| Backup | File copy | pg_dump, PITR |
| Recommended for | Development | Production |
Migration Steps
1. Set Up PostgreSQL
# Install PostgreSQL
sudo apt install postgresql
# Create database and user
sudo -u postgres createuser gauzy
sudo -u postgres createdb gauzy -O gauzy
sudo -u postgres psql -c "ALTER USER gauzy PASSWORD 'your-password';"
2. Export SQLite Data
# Use the Gauzy export tool
curl -H "Authorization: Bearer $TOKEN" \
http://localhost:3000/api/export/all \
-o gauzy-data-export.json
3. Update Configuration
Change .env:
- DB_TYPE=sqlite
- DB_NAME=gauzy.sqlite3
+ DB_TYPE=postgres
+ DB_HOST=localhost
+ DB_PORT=5432
+ DB_NAME=gauzy
+ DB_USER=gauzy
+ DB_PASS=your-password