Zimbra Tips : How to Move/Migrate CBPolicyD Database

Posted by

To migrate CBPolicyD database from old server to new server, I usually use two methods. The first method is rsync from the old server to the new server. The second method is to export/dump the database on the old server. Then import it on a new server.

1. Move/Migrate database using Rsync

Please stop all Zimbra services (especially cbpolicyd service) to ensure there is no locked database. Run this command from the old server

rsync -avP /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb root@newserver:/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb

Now, you can restart the Zimbra service on the new server. Then check the cbpolicyd.sqlitedb from Web Admin or the sqlite3 command

2. Export/Import database

# On the old server

export database

cd /opt/zimbra/data/cbpolicyd/db/
sqlite3 cbpolicyd.sqlitedb ".dump $i" >> /tmp/dmp-cbpolicyd.sql
PolicyD Web Admin

rsync the export result to the new server

rsync -avP /tmp/dmp-cbpolicyd.sql root@newserver:/tmp/

# On the new server

cd /opt/zimbra/data/cbpolicyd/db/
sqlite3 cbpolicyd.sqlitedb < /tmp/dmp-cbpolicyd.sql

You can check the import result by access cbpolicyd.sqlitedb database from WebUI or sqlite3 command

Good luck 🙂

6 comments

    1. Hi Albert,
      To upgrade Zimbra, you can download Zimbra 9 binary and install it as usual. If asked “Do you want to upgrade”, choose Yes

  1. Hi iman , i migrate zimbra 8.8 on ubuntu 16.04 to ubuntu 20.04 , after my service policyd can’t not start ,
    i follow this guide https://std.rocks/gnulinux_projects_migrate_zimbra_ubuntu.html
    Host mail.host.com
    Stopping zmconfigd…Done.
    Stopping zimlet webapp…Done.
    Stopping zimbraAdmin webapp…Done.
    Stopping zimbra webapp…Done.
    Stopping service webapp…Done.
    Stopping stats…Done.
    Stopping mta…Done.
    Stopping spell…Done.
    Stopping snmp…Done.
    Stopping cbpolicyd…Done.
    Stopping archiving…Done.
    Stopping opendkim…Done.
    Stopping amavis…Done.
    Stopping antivirus…Done.
    Stopping antispam…Done.
    Stopping proxy…Done.
    Stopping memcached…Done.
    Stopping mailbox…Done.
    Stopping logger…Done.
    Stopping dnscache…Done.
    Stopping ldap…Done.
    Host mail.host.com
    Starting ldap…Done.
    Starting zmconfigd…Done.
    Starting logger…Done.
    Starting mailbox…Done.
    Starting memcached…Done.
    Starting proxy…Done.
    Starting amavis…Done.
    Starting antispam…Done.
    Starting antivirus…Done.
    Starting opendkim…Done.
    Starting cbpolicyd…Failed.
    Starting policyd…failed.

    Starting snmp…Done.
    Starting spell…Done.
    Starting mta…Done.
    Starting stats…Done.
    Starting service webapp…Done.
    Starting zimbra webapp…Done.
    Starting zimbraAdmin webapp…Done.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.