🔽 Why this setup?
Developers sometimes need a fully portable Odoo development environment they can carry on a USB stick and run on different Windows machines (example: training machines, demos, workshops). On Windows 11 Home (Single Language) you might face locale/collation mismatches between PostgreSQL and Odoo — using the C collation or the correct locale at database initialization side-steps many of those problems and produces reliable sorting/index behavior. :contentReference[oaicite:0]{index=0}
🧭 1) Downloading Odoo 19 and Preparing for USB Installation
Odoo provides Community and Enterprise downloads and the source for on-premise installs. For a portable/developer setup we recommend using the Community source (zip or git clone) and a portable Python runtime placed on the USB stick. You can get Odoo downloads and source from the official Odoo download page or the GitHub repository. :contentReference[oaicite:1]{index=1}
Step-by-step (Odoo on USB — conceptual)
- Prepare the USB stick: Use a fast USB 3.0 drive, format as NTFS (supports files larger than 4GB and Windows ACLs).
- Create a folder structure: e.g.
\Odoo19\,\Odoo19\python\,\Odoo19\odoo\,\Odoo19\data\. - Portable Python: Copy a portable Python (matching Odoo's supported Python version) into
\Odoo19\python\, or install Python on the host and use a virtualenv placed on the USB. - Get Odoo sources: Clone or unzip the Odoo 19 Community sources into
\Odoo19\odoo\. Follow Odoo’s source install instructions for dependencies and requirements. :contentReference[oaicite:2]{index=2} - Install Python dependencies locally: Use pip to install requirements into the virtualenv on the USB (requests, psycopg2-binary, passlib, Babel, etc.).
- Data folder: Keep the filestore and database dump files in
\Odoo19\data\so the whole environment is self-contained.
Note: Running from USB will be slower than a local SSD. Use this for demos, training, or development — not production. Keep backups of your data.
🗄️ 2) PostgreSQL 18.1 on Windows 11 Home (Single Language) — install & C collation
Download the official Windows installer (EDB / PostgreSQL distribution) for PostgreSQL 18.1 and run the installer to create a new PostgreSQL cluster. PostgreSQL provides Windows installers and release notes on the official site. :contentReference[oaicite:3]{index=3}
Why C collation?
On Windows, available collations depend on the OS locales. If your Windows edition (Single Language) lacks certain locales, creating databases expecting a missing locale can fail. Using the C collation (or a supported ICU collation) avoids locale-dependent failures because it's a simple byte-wise (binary) collation that is available across systems — which is especially handy for portable or cross-machine development setups. PostgreSQL's docs discuss collation and how collations are tied to the OS capabilities. :contentReference[oaicite:4]{index=4}
Installation & Initialization (practical steps)
- Run the Windows installer (download from PostgreSQL official page or EDB). During install choose a convenient installation path (e.g.,
C:\Program Files\PostgreSQL\18\), note the postgres user password. :contentReference[oaicite:5]{index=5} - Initialize the cluster with C collation (if the installer GUI does not expose an explicit locale option): you can reinitialize the database cluster using
initdbwith the locale options. Example command (run as Administrator or the postgres user):
// Example (Windows PowerShell) - reinitialize cluster with C locale
& "C:\Program Files\PostgreSQL\18\bin\initdb.exe" -D "C:\PostgresData" --locale=C --encoding=UTF8
If you already created a database cluster with an undesired locale, you must re-create (dump/reload) the database with the desired collation/locale — PostgreSQL does not allow changing a database's LC_COLLATE/LC_CTYPE after creation. Use pg_dumpall / pg_restore or recreate the cluster as needed. :contentReference[oaicite:6]{index=6}
Tip: Starting with newer Postgres versions, ICU and built-in C.UTF-8 improvements reduce locale headaches; check your Postgres release notes and docs about collations and ICU if you need Unicode-aware sorting while maintaining stable behavior. :contentReference[oaicite:7]{index=7}
⚙️ 3) Odoo19 Configuration (odoo.conf) for portable setup
After you have PostgreSQL running (cluster initialized with C collation) and your Odoo source + Python env on the USB, configure odoo.conf to point to your DB and filestore. Below are the essential entries you will set or adapt for a portable environment.
[options]
; For portable setup, use relative or explicit paths pointing to the USB drive root
addons_path = C:\Odoo19\odoo\addons
data_dir = C:\Odoo19\data
db_host = localhost
db_port = 5432
db_user = postgres
db_password = your_postgres_password
db_name = False
xmlrpc_port = 8069
logfile = C:\Odoo19\data\odoo.log
; other options: admin_passwd, longpolling_port, workers (0 for dev), etc.
Key notes:
- db_host: For a portable single-machine setup, keep PostgreSQL on the same host (localhost). If you run Postgres on a separate PC, set the host accordingly.
- data_dir: Keep filestore and filerepo on the USB drive so attachments and generated assets move with the drive.
- workers: Use
workers = 0for development to avoid multiprocessing complexities on USB and Windows demos; use workers > 0 for production on servers with stable disks.
✅ Quick Checklist before first run
- Postgres cluster created with C collation or compatible locale.
- Postgres service is running and reachable on
localhost:5432. - Python virtualenv on USB contains required packages (psycopg2-binary, Babel, etc.).
- odoo.conf paths point to USB folders and correct DB credentials.
- Permissions: Windows user has access to folders on the USB; antivirus does not block scripts.
⚠️ Troubleshooting & Notes
- Locale/Collation errors: If Odoo or Postgres complains about locale or index mismatch, recreate the DB using the C collation or dump/reload after reinitializing the cluster. :contentReference[oaicite:8]{index=8}
- Performance: Running on USB is slower — use USB 3.0 and avoid heavy indexing tasks during demos.
- Windows Single Language: This edition restricts installed display languages but does not prevent you from setting cluster locale to C; the issue is the OS’s supported locales — prefer C or ICU-supported collations to avoid mismatches. :contentReference[oaicite:9]{index=9}
⚠️ ODOO 19 Portable Development USB Stick experience
🎥 Watch the Setup Walkthrough
See the full step-by-step demo where I prepare the USB, install PostgreSQL with C collation, configure odoo.conf, and run Odoo 19 locally.
If the video helped you, please LIKE, SUBSCRIBE, and leave a COMMENT — it really helps the channel! 🙏
References: Odoo downloads & docs, PostgreSQL downloads and docs on collations and initdb. :contentReference[oaicite:10]{index=10}
© 2025 — Odoo Portable Workshop — All Rights Reserved.



No comments:
Post a Comment