Moving Odoo to a new server is one of the most common tasks for growing businesses — whether you're upgrading hardware, switching hosting providers, or consolidating infrastructure. Done correctly, you can complete the migration with less than 15 minutes of downtime. Here's the exact process.
Migration Overview
A complete Odoo migration involves five stages:
- Prepare the new server
- Dump the database on the source server
- Restore the database on the target server
- Copy the filestore
- Update configuration and cut over DNS
All of these except DNS cutover can be done while the old server is still live, minimizing actual downtime to the final sync and DNS propagation.
Step 1: Prepare the New Server
Install Odoo on the new server in exactly the same version as the source. Don't create or initialize a database yet — you'll be restoring one.
Also install:
- PostgreSQL (same major version as source — check with
psql --version) rsyncfor filestore transfer- Your web server (nginx) — see Odoo Nginx reverse proxy setup
Verify the new server meets Odoo server requirements for your expected load.
Step 2: Pre-Migration Sync (Live Source)
While the old server is still running, do an initial filestore sync to transfer the bulk of data:
rsync -avz --progress \
/var/lib/odoo/.local/share/Odoo/filestore/mydb/ \
newserver:/var/lib/odoo/.local/share/Odoo/filestore/mydb/
This can run for hours on large filestores — do it before the maintenance window.
Step 3: Maintenance Window — Freeze the Source
Announce a maintenance window, then stop Odoo on the source server:
sudo systemctl stop odoo
From this point, no new data is written to the source. Your downtime clock has started.
Step 4: Final Database Dump
sudo -u postgres pg_dump \
-Fc \
-U odoo \
mydb \
-f /tmp/mydb_final.dump
Transfer the dump to the new server:
rsync -avz --progress /tmp/mydb_final.dump newserver:/tmp/mydb_final.dump
Step 5: Final Filestore Sync
Run the rsync again to catch any changes since the pre-migration sync:
rsync -avz --delete \
/var/lib/odoo/.local/share/Odoo/filestore/mydb/ \
newserver:/var/lib/odoo/.local/share/Odoo/filestore/mydb/
The --delete flag removes files on the target that no longer exist on the source, ensuring an exact copy.
Step 6: Restore on the New Server
On the new server:
# Create the database
sudo -u postgres psql -c "CREATE DATABASE mydb OWNER odoo;"
# Restore the dump
sudo -u postgres pg_restore \
--no-owner \
--role=odoo \
-j 4 \
-d mydb \
/tmp/mydb_final.dump
# Fix filestore permissions
sudo chown -R odoo:odoo /var/lib/odoo/.local/share/Odoo/filestore/mydb
Step 7: Update odoo.conf on the New Server
Review and update /etc/odoo/odoo.conf (or your config file location) on the new server:
[options]
db_host = localhost
db_port = 5432
db_user = odoo
db_password = your_db_password
db_name = mydb
data_dir = /var/lib/odoo/.local/share/Odoo
logfile = /var/log/odoo/odoo.log
workers = 4
# See /blog/configure-odoo-workers for worker sizing
Step 8: Start Odoo and Verify
sudo systemctl start odoo
sudo tail -f /var/log/odoo/odoo.log
Access Odoo via the new server's IP address directly (bypassing DNS) to verify it works before cutting over:
curl -H "Host: yourdomain.com" http://NEW_SERVER_IP/web/login
Or add a temporary entry to your local /etc/hosts:
NEW_SERVER_IP yourdomain.com
Step 9: Update web.base.url
In Odoo, go to Settings > Technical > System Parameters and update web.base.url to the new server's domain (or the same domain if you're keeping it). This is critical — an incorrect web.base.url causes broken links in emails, payment redirects, and portal access.
Step 10: DNS Cutover
Update your DNS A record to point to the new server's IP. Set a low TTL (60 seconds) 24 hours before the migration so the change propagates quickly.
After DNS propagates:
- Confirm SSL is working (renew or copy certificates)
- Monitor the Odoo log for the first 30 minutes
- Keep the old server running (but stopped) for 48 hours as a fallback
How DeployMonkey Simplifies Server Migrations
DeployMonkey manages your Odoo instance in Docker on your own VPS. When you need to move to a new server, you restore from your S3 backup with one click — no manual pg_dump, no rsync sessions, no config file editing. Just provision a new instance, point it at your backup, and let DeployMonkey handle the rest. Try it free.
Frequently Asked Questions
How long does an Odoo migration take?
The actual downtime (with pre-migration sync done) is typically 5–20 minutes for small-to-medium databases. Large databases (10+ GB) may take longer for the final dump and restore. The pre-migration filestore sync can run in the background without downtime.
Do I need to use the same PostgreSQL version on the new server?
Using the same major version is safest. You can restore a dump from an older PostgreSQL version to a newer one (e.g., PG 14 to PG 16), but not the reverse. Always test the restore before cutting over DNS.
What happens to email notifications during migration?
Outgoing emails queued in Odoo's mail queue will be held until Odoo is running again. Configure your SMTP settings on the new server before starting Odoo to avoid losing queued messages.
Can I migrate while keeping the same domain and SSL certificate?
Yes. Copy the SSL certificates from the old server to the new server (typically /etc/letsencrypt/), or issue a new certificate with certbot after DNS propagates. If using Let's Encrypt, run certbot certonly on the new server once DNS has propagated.
How do I roll back if something goes wrong after DNS cutover?
Change the DNS A record back to the old server's IP. Since you kept the old server running, it can resume serving traffic immediately. If any data was written to the new server during the brief cutover period, you'll need to manually reconcile those records.