How-To Guides
Migrate from Self-Hosted

Migrate from Self-Hosted Odoo

Move your existing self-hosted Odoo installation to OEC.sh for easier management, automated backups, and professional monitoring.


Overview

Migrating from a self-hosted Odoo installation involves:

  1. Creating a backup of your database and filestore
  2. Uploading to cloud storage
  3. Importing into OEC.sh

Same Version Required: You must migrate to the same Odoo version. Version upgrades require Odoo's paid upgrade service (Enterprise only).


Prerequisites

  • SSH access to your current server
  • Database credentials (PostgreSQL user/password)
  • OEC.sh account with a server configured
  • Cloud storage configured (S3, R2, or B2)
  • Sufficient disk space for backup creation

Step 1: Create Backup on Source Server

SSH into your current Odoo server and create a complete backup.

Find Your Odoo Configuration

# Common locations for odoo.conf
cat /etc/odoo/odoo.conf
# or
cat /etc/odoo-server.conf
# or
cat ~/.odoorc

Note these values:

  • db_name - Your database name
  • data_dir - Location of filestore (usually /var/lib/odoo or ~/.local/share/Odoo)

Create Database Dump

# Create backup directory
mkdir -p ~/odoo_backup
 
# Dump the database
pg_dump -U odoo -h localhost YOUR_DATABASE_NAME -F c -f ~/odoo_backup/dump.sql
 
# Or for plain SQL format
pg_dump -U odoo -h localhost YOUR_DATABASE_NAME > ~/odoo_backup/dump.sql
⚠️

Replace YOUR_DATABASE_NAME with your actual database name. The user (-U odoo) may differ based on your setup.

Copy Filestore

# Find your filestore location
ls -la /var/lib/odoo/filestore/
# or
ls -la ~/.local/share/Odoo/filestore/
 
# Copy filestore to backup directory
cp -r /var/lib/odoo/filestore/YOUR_DATABASE_NAME ~/odoo_backup/filestore

Create Backup Archive

cd ~/odoo_backup
 
# Create ZIP archive (OEC.sh compatible format)
zip -r odoo_backup_$(date +%Y%m%d).zip dump.sql filestore/
 
# Check the file size
ls -lh odoo_backup_*.zip

Step 2: Upload to Cloud Storage

Transfer your backup to cloud storage for import into OEC.sh.

AWS CLI (for S3/R2):

# Install AWS CLI if needed
apt install awscli -y
 
# Configure credentials
aws configure
 
# Upload to S3
aws s3 cp ~/odoo_backup/odoo_backup_*.zip s3://your-bucket/migrations/
 
# For Cloudflare R2
aws s3 cp ~/odoo_backup/odoo_backup_*.zip s3://your-bucket/migrations/ \
  --endpoint-url https://ACCOUNT_ID.r2.cloudflarestorage.com

Step 3: Import into OEC.sh

Configure Storage Provider

If not already done:

  1. Go to Settings → Storage Providers
  2. Add your cloud storage credentials
  3. Test the connection

Create New Project

  1. Go to Projects
  2. Click New Project
  3. Select Migrate from Backup

Select Backup Source

  1. Choose your storage provider
  2. Navigate to your backup file
  3. Click Validate

OEC.sh will detect:

  • Odoo version (from dump.sql)
  • Database size
  • Filestore size

Configure Environment

  1. Set project name
  2. Select matching Odoo version
  3. Choose target server
  4. Allocate resources (CPU, RAM, disk)

Start Migration

Click Start Migration to begin the import process.


Step 4: Post-Migration Configuration

Update System Parameters

  1. Access your new Odoo instance
  2. Go to Settings → Technical → System Parameters
  3. Update these parameters:
ParameterNew Value
web.base.urlhttps://your-new-domain.com
web.base.url.freezeTrue
mail.catchall.domainYour email domain

Configure Outgoing Email

  1. Go to Settings → General Settings
  2. Configure outgoing mail server
  3. Test email delivery

Update DNS

If keeping your domain:

  1. Update A record to point to new server IP
  2. Or add domain in Environment → Domains

Verify Scheduled Actions

  1. Go to Settings → Technical → Scheduled Actions
  2. Check all cron jobs are active
  3. Verify next execution times

Large Database Considerations

For databases larger than 10GB:

Before Migration

  1. Clean up data:

    -- Remove old mail messages (keep last 6 months)
    DELETE FROM mail_message
    WHERE date < NOW() - INTERVAL '6 months'
    AND model != 'mail.channel';
     
    -- Clean ir.logging
    TRUNCATE ir_logging;
     
    -- Vacuum the database
    VACUUM FULL ANALYZE;
  2. Archive old attachments:

    -- Find large attachments
    SELECT name, pg_size_pretty(file_size)
    FROM ir_attachment
    ORDER BY file_size DESC
    LIMIT 20;

During Migration

  • Use a server with sufficient RAM (at least 8GB)
  • Allow extra time for restore
  • Monitor disk space during import

Handling Custom Modules

Identify Custom Modules

On your source server:

# List addon paths from config
grep addons_path /etc/odoo/odoo.conf
 
# List installed modules
psql -U odoo -d YOUR_DATABASE -c "SELECT name FROM ir_module_module WHERE state = 'installed';"

Transfer Custom Modules

  1. Copy your custom modules:

    tar -czvf custom_addons.tar.gz /path/to/custom/addons/
  2. In OEC.sh, add as addon repository:

    • Go to Project → Repositories
    • Add your Git repository containing custom modules
    • Or upload directly to the environment

Common Issues

Permission Denied During pg_dump

# Switch to postgres user
sudo -u postgres pg_dump YOUR_DATABASE > dump.sql

Filestore Not Found

Check Odoo data directory:

grep data_dir /etc/odoo/odoo.conf
# Default: /var/lib/odoo or ~/.local/share/Odoo

Version Detection Failed

Manually check your Odoo version:

# From Python
python3 -c "import odoo; print(odoo.release.version)"
 
# Or check installed package
dpkg -l | grep odoo

Import Timeout

For very large databases:

  1. Contact OEC.sh support
  2. Consider splitting into database + filestore imports
  3. Use a high-spec server for initial import

Verification Checklist

After migration, verify:

  • Admin and user logins work
  • All data is present (spot check key records)
  • Attachments and images load correctly
  • Custom modules function properly
  • Reports generate correctly
  • Email sending/receiving works
  • Scheduled actions execute properly
  • Integrations (payment, shipping) work

Decommissioning Old Server

Once verified:

  1. Keep old server running for at least 2 weeks
  2. Create final backup on old server
  3. Update DNS to point to new server
  4. Monitor for any missed configurations
  5. Shut down old server after confirmation
  6. Delete old server after retention period

Tip: Keep your final backup stored securely for at least 90 days after migration.


Need Help?

For migration assistance:

  • Email: [email protected]
  • Include: Current Odoo version, database size, any custom modules