{"id":7,"date":"2015-07-22T11:56:38","date_gmt":"2015-07-22T11:56:38","guid":{"rendered":"http:\/\/192.168.0.111\/wordpress\/?p=7"},"modified":"2015-07-22T11:56:38","modified_gmt":"2015-07-22T11:56:38","slug":"synology-zarafa-database-backup-and-restore-migrate","status":"publish","type":"post","link":"http:\/\/wordpress.joontech.nl\/?p=7","title":{"rendered":"Synology: Zarafa database backup and restore (migrate)"},"content":{"rendered":"<p>The backup can be done while the sever is running. For restoring, the server must be stopped first.<\/p>\n<p>Backup with mysqldunp:<\/p>\n<pre>mysqldump -u root -p &lt;password&gt; -h localhost --skip-lock-tables --single-transaction --databases zarafa &gt; zarafa.dump.sql<\/pre>\n<p>Restore with mysql<\/p>\n<pre>mysql -u root -p &lt;password&gt; zarafa &lt; zarafa.dump.sql<\/pre>\n<p>Sometimes the dump was created with chunks bigger then the server accepts:<br \/>\n<em>ERROR 1153 (08S01) at line 6734: Got a packet bigger than &#8216;max_allowed_packet&#8217; bytes<\/em><\/p>\n<p>Then open a terminal with <em>mysql -u root<\/em><\/p>\n<p>and enter the following<\/p>\n<pre class=\"lang-sql prettyprint prettyprinted\"><code><span class=\"kwd\">mysql -u root\r\nset<\/span><span class=\"pln\"> global net_buffer_length<\/span><span class=\"pun\">=<\/span><span class=\"lit\">1000000<\/span><span class=\"pun\">;<\/span> \r\n<span class=\"kwd\">set<\/span><span class=\"pln\"> global max_allowed_packet<\/span><span class=\"pun\">=<\/span><span class=\"lit\">1000000000<\/span><span class=\"pun\">;<\/span><\/code><\/pre>\n<p>Leave the terminal open, and use the following in a new terminal:<\/p>\n<pre>mysql -u root -p &lt;password&gt;\u00a0--max_allowed_packet=100M zarafa &lt; zarafa.dump.sql<\/pre>\n<p>Don&#8217;t forget the attachments, since they are saved separately. Backup with:<\/p>\n<pre>tar -zcvf zarafa_attachment.tar.gz \/var\/lib\/zarafa\/<\/pre>\n<p>And restore the attachments with:<\/p>\n<pre>tar -zxvf zarafa_attachement.tar.gz\r\nrm -rf \/var\/lib\/zarafa\/*\r\nmv var\/lib\/zarafa\/* \/var\/lib\/zarafa\r\nchown -R zarafa:zarafa \/var\/lib\/zarafa<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The backup can be done while the sever is running. For restoring, the server must be stopped first. Backup with mysqldunp: mysqldump -u root -p &lt;password&gt; -h localhost &#8211;skip-lock-tables &#8211;single-transaction &#8211;databases zarafa &gt; zarafa.dump.sql Restore with mysql mysql -u root -p &lt;password&gt; zarafa &lt; zarafa.dump.sql Sometimes the dump was created with chunks bigger then the &hellip; <a href=\"http:\/\/wordpress.joontech.nl\/?p=7\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Synology: Zarafa database backup and restore (migrate)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/wordpress.joontech.nl\/index.php?rest_route=\/wp\/v2\/posts\/7","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wordpress.joontech.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wordpress.joontech.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wordpress.joontech.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/wordpress.joontech.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7"}],"version-history":[{"count":6,"href":"http:\/\/wordpress.joontech.nl\/index.php?rest_route=\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":13,"href":"http:\/\/wordpress.joontech.nl\/index.php?rest_route=\/wp\/v2\/posts\/7\/revisions\/13"}],"wp:attachment":[{"href":"http:\/\/wordpress.joontech.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wordpress.joontech.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wordpress.joontech.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}