When Odoo is installed on Windows via the official .exe installer, the directory structure, user names, and commands differ from Linux. This section covers common operations for Windows installations.
Default Paths (Installer)
Odoo Install: C:\Program Files\Odoo 19.0e.YYYYMMDD\
PostgreSQL: C:\Program Files\Odoo 19.0e.YYYYMMDD\PostgreSQL\
Config File: C:\Program Files\Odoo 19.0e.YYYYMMDD\server\odoo.conf
pg_hba.conf: C:\Program Files\Odoo 19.0e.YYYYMMDD\PostgreSQL\data\pg_hba.conf
Filestore: C:\Users\Admin\AppData\Local\OpenERP S.A\Odoo\filestore\
Service Name: odoo-server-19.0
Path varies by version. Replace 19.0e.YYYYMMDD with your actual folder name — check dir "C:\Program Files\" | findstr Odoo to see the exact name.
PowerShell Basics (Run as Administrator)
All commands below require PowerShell as Administrator: right-click Start → Terminal (Admin). Without admin, you'll get System error 5: Access is denied.
# ── Service Management ──
net stop "odoo-server-19.0"
net start "odoo-server-19.0"
# ── View Configuration ──
type "C:\Program Files\Odoo 19.0e.YYYYMMDD\server\odoo.conf"
# ── Edit Configuration ──
notepad "C:\Program Files\Odoo 19.0e.YYYYMMDD\server\odoo.conf"
PostgreSQL Commands
The Windows installer creates a PostgreSQL user called openpg (not odoo or postgres like on Linux). All psql and pg_* commands use -U openpg.
# ══════════════════════════════════════════════════════════════
# STEP 1: Run these TWO lines FIRST every time you open PowerShell
# (they reset when you close the window)
# ══════════════════════════════════════════════════════════════
$pg = "C:\Program Files\Odoo 19.0e.YYYYMMDD\PostgreSQL\bin"
$env:PGPASSWORD="your_db_password"
# Find your password: type "C:\...\server\odoo.conf" | findstr db_password
# ══════════════════════════════════════════════════════════════
# STEP 2: Now use any command below
# ══════════════════════════════════════════════════════════════
# ── List all databases ──
& "$pg\psql.exe" -U openpg -d postgres -l
# ── Connect to a database (interactive SQL) ──
& "$pg\psql.exe" -U openpg -d enterprise
# ── Run a quick SQL query ──
& "$pg\psql.exe" -U openpg -d enterprise -c "SELECT count(*) FROM res_users;"
# ── List database roles/users ──
& "$pg\psql.exe" -U openpg -d postgres -c "\du"
Always use -d postgres for admin commands (list databases, alter users, etc.). Without -d, psql tries to connect to a database named after the user (openpg), which may not exist and gives: FATAL: database "openpg" does not exist.
$pg and $env:PGPASSWORD reset every time you close PowerShell. You must set them again in each new session. Alternatively, always use the full path: & "C:\Program Files\Odoo 19.0e.YYYYMMDD\PostgreSQL\bin\psql.exe" -U openpg -d postgres -l
Backup & Restore
Ensure $pg and $env:PGPASSWORD are set first (see above).
# ── Create backup folder ──
mkdir C:\backup
# ── Backup (custom format, compressed) ──
& "$pg\pg_dump.exe" -U openpg -Fc enterprise > C:\backup\enterprise.dump
# ── Restore ──
# 1. Stop Odoo first
net stop "odoo-server-19.0"
# 2. Drop old database (if replacing)
& "$pg\dropdb.exe" -U openpg enterprise
# 3. Create fresh database
& "$pg\createdb.exe" -U openpg enterprise
# 4. Restore from dump
& "$pg\pg_restore.exe" -U openpg -d enterprise "C:\backup\enterprise.dump"
# 5. Start Odoo
net start "odoo-server-19.0"
Restore from Linux Server (Cross-Version)
If the dump was created with a newer PostgreSQL (e.g. v16 on Linux) and your Windows has an older version (e.g. v12), pg_restore will fail with unsupported version (1.15) in file header. Use a plain SQL dump instead:
# ── On the Linux server: Create plain SQL dump ──
sudo -u postgres pg_dump --format=plain --no-owner --no-privileges your_database > /tmp/database_plain.sql
# Compress (1.9GB → ~200MB)
gzip /tmp/database_plain.sql
# Transfer to Windows via SCP, WinSCP, FileZilla, etc.
# ── On Windows: Decompress and restore ──
# Decompress the .gz file using 7-Zip or WinRAR first
# Drop and recreate
& "$pg\dropdb.exe" -U openpg your_database
& "$pg\createdb.exe" -U openpg your_database
# Restore using psql (not pg_restore — plain SQL uses psql)
& "$pg\psql.exe" -U openpg -d your_database -f "C:\path\to\database_plain.sql"
# Verify
& "$pg\psql.exe" -U openpg -d your_database -c "SELECT count(*) FROM res_users;"
# Update odoo.conf with the database name
notepad "C:\Program Files\Odoo 19.0e.YYYYMMDD\server\odoo.conf"
# Set: db_name = your_database
# Start Odoo
net start "odoo-server-19.0"
Plain SQL dumps are large (often 1-2GB+ uncompressed). Always gzip on the server before transferring. The restore will take several minutes for large databases.
\unrestrict error at the end? This is a PostgreSQL 16+ command not recognized by older versions. It's harmless — the data is fully restored. Verify with SELECT count(*) FROM res_users;
Password Reset
If you forgot the PostgreSQL password or get password authentication failed:
# 1. Stop Odoo
net stop "odoo-server-19.0"
# 2. Edit pg_hba.conf — change all "md5" to "trust" temporarily
notepad "C:\Program Files\Odoo 19.0e.YYYYMMDD\PostgreSQL\data\pg_hba.conf"
# Change lines to:
# host all all 127.0.0.1/32 trust
# host all all ::1/128 trust
# 3. Start Odoo (restarts PostgreSQL too)
net start "odoo-server-19.0"
# 4. Connect without password and reset (use FULL PATH + -d postgres)
& "C:\Program Files\Odoo 19.0e.YYYYMMDD\PostgreSQL\bin\psql.exe" -U openpg -d postgres -c "ALTER USER openpg WITH PASSWORD 'new_password';"
# 5. Revert pg_hba.conf back to "md5" (CRITICAL for security!)
notepad "C:\Program Files\Odoo 19.0e.YYYYMMDD\PostgreSQL\data\pg_hba.conf"
# Change back to:
# host all all 127.0.0.1/32 md5
# host all all ::1/128 md5
# 6. Update odoo.conf with the new password
notepad "C:\Program Files\Odoo 19.0e.YYYYMMDD\server\odoo.conf"
# Set: db_password = new_password
# 7. Restart
net stop "odoo-server-19.0"
net start "odoo-server-19.0"
# 8. Verify (set password variable first)
$env:PGPASSWORD="new_password"
& "C:\Program Files\Odoo 19.0e.YYYYMMDD\PostgreSQL\bin\psql.exe" -U openpg -d postgres -l
🔒 Never leave trust in pg_hba.conf! It allows anyone to connect without a password. Always revert to md5 after resetting.
pg_hba.conf syntax errors cause FATAL: could not load pg_hba.conf. If this happens, re-open the file and check for typos, extra spaces, or missing columns. Each line must have exactly: TYPE DATABASE USER ADDRESS METHOD.
Key Differences: Windows vs Linux
| Item | Linux (Ubuntu) | Windows (Installer) |
| PostgreSQL user | odoo | openpg |
| Default database | production_db (you name it) | enterprise (auto-created) |
| Service control | sudo systemctl start/stop odoo | net start/stop "odoo-server-19.0" |
| Admin required | sudo | PowerShell as Administrator |
| Config file | /etc/odoo/odoo.conf | C:\...\server\odoo.conf |
| Filestore | /opt/odoo/.local/share/Odoo/filestore/ | C:\Users\...\AppData\Local\OpenERP S.A\Odoo\filestore\ |
| Run as service user | sudo -u odoo ... | Not needed (runs as Windows service) |
| pg_hba.conf auth | peer (Unix socket) | md5 (TCP only, password always required) |
| psql default DB | Connects to user's DB | Must specify -d postgres |
| Template databases | template0, template1, postgres — never delete these |
Common Windows Errors
System error 5: Access is denied
Not running as Administrator. Right-click Start → Terminal (Admin).
The term '\psql.exe' is not recognized
The $pg variable was not set in this session. PowerShell variables reset when you close the window. Set it again: $pg = "C:\Program Files\Odoo 19.0e.YYYYMMDD\PostgreSQL\bin"
FATAL: database "openpg" does not exist
Missing -d flag. Add -d postgres to your command (or the name of your actual database).
FATAL: password authentication failed
Wrong password. Check db_password in odoo.conf, or reset via the pg_hba.conf trust method above.
FATAL: could not load pg_hba.conf
Syntax error in pg_hba.conf. Open it and check each line has exactly: TYPE, DATABASE, USER, ADDRESS, METHOD — separated by spaces/tabs.
FATAL: role "odoo" does not exist / role "postgres" does not exist
Windows installer uses openpg as the PostgreSQL user, not odoo or postgres. Always use -U openpg.
unsupported version (1.15) in file header
The dump was created with a newer PostgreSQL than yours (e.g. dump from v16, restoring on v12). Use plain SQL dump instead: on the source server run pg_dump --format=plain --no-owner, then restore with psql -f instead of pg_restore. See "Restore from Linux Server" above.
invalid command \unrestrict at end of restore
Harmless. This is a PostgreSQL 16+ command not recognized by older versions. Your data is fully restored — verify with SELECT count(*) FROM res_users;
type "vector" does not exist during module upgrade
pgvector extension not installed. See "Install pgvector on Windows" section below. Download pre-compiled binaries, copy to PostgreSQL directory, then run CREATE EXTENSION IF NOT EXISTS vector;
Template databases: template0, template1, and postgres are system databases required by PostgreSQL. Deleting them will prevent creating new databases. Only delete databases you created yourself.
Upgrade PostgreSQL (e.g. 12 → 16)
The Odoo Windows installer bundles an older PostgreSQL (often v12). Odoo 19 requires 13+ minimum (16 recommended for pgvector/AI features). Two methods available:
Method A: Clean Install (Recommended)
Uninstall old PostgreSQL completely, then install new. Simpler and avoids port conflicts.
# ── Step 1: Backup database (BOTH formats for safety) ──
mkdir C:\backup
& "$pg\pg_dump.exe" -U openpg -Fc your_database > C:\backup\database.dump
& "$pg\pg_dump.exe" -U openpg --format=plain --no-owner your_database > C:\backup\database_plain.sql
# ── Step 2: Backup odoo.conf and filestore ──
copy "C:\Program Files\Odoo 19.0\server\odoo.conf" C:\backup\odoo.conf.bak
xcopy "C:\Users\Admin\AppData\Local\OpenERP S.A\Odoo\filestore" "C:\backup\filestore\" /E /I
# ── Step 3: Stop everything ──
net stop "odoo-server-19.0"
# ── Step 4: Uninstall old PostgreSQL ──
# Control Panel → Programs → Uninstall:
# - Uninstall any standalone PostgreSQL (e.g. PostgreSQL 15)
# - Uninstall Odoo (removes bundled PostgreSQL 12 with it)
# Or disable old service: sc config "PostgreSQL_For_Odoo" start= disabled
# ── Step 5: Install PostgreSQL 16 ──
# Download from https://www.postgresql.org/download/windows/ (EDB installer)
# During install:
# Port: 5432 (standard)
# Superuser (postgres) password: remember it!
# ── Step 6: Install pgvector (see section below) ──
# ── Step 7: Create user and database ──
$pg16 = "C:\Program Files\PostgreSQL\16\bin"
$env:PGPASSWORD="postgres_superuser_password"
& "$pg16\psql.exe" -U postgres -d postgres -c "CREATE USER openpg WITH SUPERUSER CREATEDB PASSWORD 'your_db_password';"
$env:PGPASSWORD="your_db_password"
& "$pg16\createdb.exe" -U openpg your_database
# ── Step 8: Install pgvector extension in database ──
& "$pg16\psql.exe" -U openpg -d your_database -c "CREATE EXTENSION IF NOT EXISTS vector;"
# ── Step 9: Restore ──
# Try custom format first:
& "$pg16\pg_restore.exe" -U openpg -d your_database "C:\backup\database.dump"
# If it fails (version mismatch), use plain SQL:
& "$pg16\psql.exe" -U openpg -d your_database -f "C:\backup\database_plain.sql"
# ── Step 10: Verify ──
& "$pg16\psql.exe" -U openpg -d your_database -c "SELECT count(*) FROM res_users;"
& "$pg16\psql.exe" -U openpg -d your_database -c "SELECT version();"
# ── Step 11: Re-install Odoo ──
# Download from https://www.odoo.com/page/download
# During install, set PostgreSQL connection:
# Host: localhost, Port: 5432, User: openpg, Password: your_db_password
# ── Step 12: Update odoo.conf ──
notepad "C:\Program Files\Odoo 19.0\server\odoo.conf"
# Set: db_name = your_database
# ── Step 13: Start Odoo ──
net start "odoo-server-19.0"
# Open http://localhost:8069
# Go to Settings → Developer Tools → Update Apps List → Upgrade base module
Method B: Side-by-Side (Keep Old Running)
Install new PostgreSQL alongside old one on a different port, migrate, then switch.
# ── Install PostgreSQL 16 on port 5433 (temporary) ──
# Same EDB installer, but set port to 5433 during install
$pg16 = "C:\Program Files\PostgreSQL\16\bin"
$env:PGPASSWORD="postgres_superuser_password"
# Create user and database on new server
& "$pg16\psql.exe" -U postgres -p 5433 -d postgres -c "CREATE USER openpg WITH SUPERUSER CREATEDB PASSWORD 'your_db_password';"
$env:PGPASSWORD="your_db_password"
& "$pg16\createdb.exe" -U openpg -p 5433 your_database
& "$pg16\psql.exe" -U openpg -p 5433 -d your_database -c "CREATE EXTENSION IF NOT EXISTS vector;"
& "$pg16\pg_restore.exe" -U openpg -p 5433 -d your_database "C:\backup\database.dump"
# After verifying, switch ports:
# Old PostgreSQL → port 5434 (or disable in services.msc)
# New PostgreSQL 16 → port 5432
# Update odoo.conf → db_port = 5432
⚠️ Don't delete old PostgreSQL until you've confirmed everything works on the new one. Keep backups in C:\backup\.
After confirming: Disable old service in services.msc → set Startup Type to "Disabled". Or uninstall from Control Panel.
Install pgvector on Windows (Manual)
Odoo 19 AI features require pgvector. It's not available in StackBuilder, so install it manually using pre-compiled binaries:
# ── Step 1: Download pre-compiled pgvector for your PostgreSQL version ──
# https://github.com/andreiramani/pgvector_pgsql_windows/releases
# Download: "pgvector v0.8.1 for PostgreSQL 16, Microsoft Windows"
# Extract the zip file
# ── Step 2: Copy files to PostgreSQL directory ──
copy "C:\Users\Admin\Downloads\vector.v0.8.1-pg16\lib\*" "C:\Program Files\PostgreSQL\16\lib\"
xcopy "C:\Users\Admin\Downloads\vector.v0.8.1-pg16\share\*" "C:\Program Files\PostgreSQL\16\share\" /E /I /Y
# ── Step 3: Restart PostgreSQL ──
net stop "postgresql-x64-16"
net start "postgresql-x64-16"
# ── Step 4: Enable in your database ──
$pg16 = "C:\Program Files\PostgreSQL\16\bin"
$env:PGPASSWORD="your_db_password"
& "$pg16\psql.exe" -U openpg -d your_database -c "CREATE EXTENSION IF NOT EXISTS vector;"
# Should output: CREATE EXTENSION
Why pgvector? Odoo 19 uses it for AI embeddings (ai_embedding table). Without it, upgrading modules fails with type "vector" does not exist. The extension only needs to be created once per database.
Match versions! Download the pgvector binary that matches your PostgreSQL version exactly. Using pg14 binaries on pg16 will not work.
Odoo Source Update (Windows Installer)
The Windows .exe installer does not use git — it installs Odoo as a standalone application. To update:
Method 1: Re-download Installer (Recommended)
# 1. Backup database
& "$pg\pg_dump.exe" -U openpg -Fc enterprise > C:\backup\enterprise_before_update.dump
# 2. Stop Odoo
net stop "odoo-server-19.0"
# 3. Download latest installer from:
# https://www.odoo.com/page/download
# Choose: Odoo 19 Enterprise (or Community) → Windows
# 4. Run the new installer
# It will detect the existing installation and update in-place
# Your database and filestore are preserved
# 5. Start Odoo
net start "odoo-server-19.0"
# 6. Update module schema (from browser)
# Go to: Settings → Developer Tools → Update Apps List
# Then update specific modules as needed
Method 2: Git Clone (For Developers)
If you want git-based updates like on Linux, install Git for Windows and clone the source:
# 1. Install Git for Windows from https://git-scm.com/download/win
# 2. Clone Odoo source (into the installer's server directory)
cd "C:\Program Files\Odoo 19.0e.YYYYMMDD\server"
git clone https://github.com/odoo/odoo.git --depth 1 --branch 19.0 odoo
git clone git@github.com:odoo/enterprise.git --depth 1 --branch 19.0 enterprise
# 3. Update odoo.conf to point to the git source
notepad "C:\Program Files\Odoo 19.0e.YYYYMMDD\server\odoo.conf"
# Update addons_path to include:
# addons_path = C:\Program Files\Odoo 19.0e.YYYYMMDD\server\odoo\addons,C:\Program Files\Odoo 19.0e.YYYYMMDD\server\enterprise
# 4. Update using same method as Linux
cd "C:\Program Files\Odoo 19.0e.YYYYMMDD\server\odoo"
git fetch
git rebase --autostash
cd "C:\Program Files\Odoo 19.0e.YYYYMMDD\server\enterprise"
git fetch
git rebase --autostash
# 5. Restart Odoo
net stop "odoo-server-19.0"
net start "odoo-server-19.0"
# 6. If conflicts occur — discard local changes:
git reset --hard origin/19.0
Installer vs Git: The .exe installer is easier to manage — just re-download and reinstall. Git clone gives you daily updates and more control, but requires manual Python environment setup. For production Windows deployments, the installer method is recommended.