Nexent Upgrade Guide
🚀 Upgrade Overview
Follow these four steps to upgrade Nexent safely:
- Clean up existing containers and images
- Pull the latest code and run the deployment script
- Apply database migrations
- Verify the deployment in your browser
🧹 Step 1: Clean up old images
Remove cached resources to avoid conflicts when redeploying:
bash
# Stop and remove existing containers
docker compose down
# Inspect Nexent images
docker images --filter "reference=nexent/*"
# Remove Nexent images
# Windows PowerShell:
docker images -q --filter "reference=nexent/*" | ForEach-Object { docker rmi -f $_ }
# Linux/WSL:
docker images -q --filter "reference=nexent/*" | xargs -r docker rmi -f
# (Optional) prune unused images and caches
docker system prune -af⚠️ Notes
- Back up critical data before deleting images.
- To preserve database data, do not delete the mounted database volume (
/nexent/docker/volumesor your custom path).
🔄 Step 2: Update code and redeploy
bash
git pull
cd nexent/docker
cp .env.example .env
bash deploy.sh💡 Tip
.env.exampleworks for default deployments.- Configure speech models (STT/TTS) in
.envwhen needed. A frontend configuration flow is coming soon.
🗄️ Step 3: Apply database migrations
Run the SQL scripts shipped with each release to keep your schema up to date.
✅ Method A: Use a SQL editor (recommended)
- Open your SQL client and create a new PostgreSQL connection.
- Retrieve connection settings from
/nexent/docker/.env:- Host
- Port
- Database
- User
- Password
- Test the connection. When successful, you should see tables under the
nexentschema. - Open a new query window.
- Navigate to
/nexent/docker/sql. Each file contains one migration script with its release date in the filename. - Execute every script dated after your previous deployment, in chronological order.
⚠️ Important
- Always back up the database first, especially in production.
- Run scripts sequentially to avoid dependency issues.
.envkeys may be namedPOSTGRES_HOST,POSTGRES_PORT, and so on—map them accordingly in your SQL client.
🧰 Method B: Use the command line (no SQL client required)
Switch to the Docker directory:
bashcd nexent/dockerRead database connection details from
.env, for example:bashPOSTGRES_HOST=localhost POSTGRES_PORT=5432 POSTGRES_DB=nexent POSTGRES_USER=root POSTGRES_PASSWORD=your_passwordExecute SQL files sequentially (host machine example):
bash# Example: If today is November 6th and your last update was on October 20th, # and there are two new files 1030-update.sql and 1105-update.sql, # execute the following commands (please replace the placeholders with your actual values) docker exec -i nexent-postgresql psql -U [YOUR_POSTGRES_USER] -d [YOUR_POSTGRES_DB] < ./sql/1030-update.sql docker exec -i nexent-postgresql psql -U [YOUR_POSTGRES_USER] -d [YOUR_POSTGRES_DB] < ./sql/1105-update.sqlExecute the scripts in chronological order based on your deployment date.
💡 Tips
Load environment variables first if they are defined in
.env:Windows PowerShell:
powershellGet-Content .env | Where-Object { $_ -notmatch '^#' -and $_ -match '=' } | ForEach-Object { $key, $value = $_ -split '=', 2; [Environment]::SetEnvironmentVariable($key.Trim(), $value.Trim(), 'Process') }Linux/WSL:
bashexport $(grep -v '^#' .env | xargs) # Or use set -a to automatically export all variables set -a; source .env; set +aCreate a backup before running migrations:
bashdocker exec -i nexent-postgres pg_dump -U [YOUR_POSTGRES_USER] [YOUR_POSTGRES_DB] > backup_$(date +%F).sql
🌐 Step 4: Verify the deployment
After deployment:
- Open
http://localhost:3000in your browser. - Review the User Guide to validate agent functionality.
