Install into an existing Odoo (Route B)
The scripted route for adding the modules to the Odoo 17 database you already use.
Route B is the "one app, one port" route. The modules go into your existing database, so they appear in the Apps list you already open, at the address you already use. There is no second port and no second database.
Before you start#
Caution
Stop your Odoo service first. Two processes migrating one database at the same time is how databases get corrupted.
You need Odoo 17, and for the AI Workforce the base module described in Choose a module.
Two scripts#
Clone the repository and run the first script. It changes nothing:
git clone https://github.com/danibest212/odoo-social-media-marketing-automation-module.git smarterp-social
cd smarterp-social/deploy
./inspect_target.sh liyu_ai_lab # use your own database name
It prints where the database lives, which Odoo version wrote it, whether the modules are already there, and what it can find of your Odoo install. Read it before going on. If base is not 17.0.x, stop and use Route A instead.
Then install:
./install_into_existing.sh --db liyu_ai_lab
If the base module is not somewhere the script can find it, point at it:
./install_into_existing.sh --db liyu_ai_lab --base-module /path/to/social_media_integration
What the installer does, in order#
- Refuses to continue unless it can see the database and
basereports17.0.x. - Takes a
pg_dump -Fcof the whole database to your home directory, and stops if that dump does not write. It prints the exact command to roll back. - Ports
social_media_integration's views from Odoo 16 to Odoo 17, keeping the originals as*.odoo16.bak. - Copies both modules into your addons path. Anything it displaces is moved out of the addons path first, so Odoo does not scan it as a module.
- Works out per module whether to install or update, and runs Odoo once.
- Prints what actually landed, read back from the database.
Flags#
| Flag | What for |
|---|---|
--dry-run | Print every step, change nothing. Worth doing first. |
--addons-path DIR | If it cannot work out where your addons live. |
--odoo-bin PATH | If odoo-bin is not on your PATH. |
--odoo-docker NAME | Your Odoo runs in a container. |
--db-docker NAME | Your PostgreSQL runs in a container. |
--seed | Also load the demo records. Never on production. |
--skip-backup | Skip the dump. Don't. |
If your PostgreSQL is on another host, set PGHOST, PGPORT and PGUSER before running either script.
Undoing it#
The backup is a full database dump:
dropdb liyu_ai_lab && createdb liyu_ai_lab
pg_restore -d liyu_ai_lab ~/liyu_ai_lab_before_ai_workforce_*.dump
What was verified#
Against a database created as a plain Odoo 17 install, standing in for a real one: the port rewrote all 91 attrs= occurrences, both modules installed, the 23-assertion smoke test passed 23 of 23, and the three refusal paths (missing database, not an Odoo database, Odoo 16 database) all stopped without writing anything. The Docker build in Route A was not exercised in that environment, because it had no Docker daemon.
After it is up#
Continue with Users and access, then Scheduled actions.