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 🙂

4 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

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.