{"id":3198,"date":"2020-06-06T05:22:06","date_gmt":"2020-06-05T23:52:06","guid":{"rendered":"https:\/\/www.24x7serversupport.com\/blog\/?p=3198"},"modified":"2020-06-06T17:02:41","modified_gmt":"2020-06-06T11:32:41","slug":"backup-sql-files-with-custombuild-2-0","status":"publish","type":"post","link":"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/","title":{"rendered":"Backup SQL files with CustomBuild 2.0"},"content":{"rendered":"\n<p>Before any changes, or for regular intervals, you might want to make backups of your database, which are not specific to the normal DirectAdmin User backup system. This guide will explain how to backup the .sql files on their own using CustomBuild.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Backup<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/usr\/local\/directadmin\/custombuild<br>.\/build set mysql_backup yes<br>.\/build mysql_backup<\/pre>\n\n\n\n<p>and if you want to prevent future calls to .\/build mysql_backup from overwriting these files, rename the backup folder<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mv mysql_backups mysql_backups.`date +%F`<\/pre>\n\n\n\n<p>Note that updating mysql, with mysql_backup=yes set in the options.conf will re-dump the databse to the mysql_backups directory.<br><br><strong>Note<\/strong>: These .sql files contain the &#8220;DROP DATABASE&#8221; and &#8220;CREATE DATABASE&#8221; commands, unlike the .sql files in the DA User backups, so they cannot be easily interchanged.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Restore<\/h4>\n\n\n\n<p>If disaster hits, and you need to restore these .sql files, once mysql is up and running and the da_admin user\/pass is working correctly, you can run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/usr\/local\/directadmin\/custombuild\/mysql_backups<br>wget http:\/\/files1.directadmin.com\/services\/all\/mysql\/restore_sql_files.sh<br>chmod 755 restore_sql_files.sh<br>.\/restore_sql_files.sh<\/pre>\n\n\n\n<p>which restores all User databases.<\/p>\n\n\n\n<p>If you also need to restore the mysql.* tables (usually avoid doing this unless you&#8217;ve lost all your mysql user\/passwords), then you&#8217;d call the script like<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/restore_sql_files.sh with_mysql<\/pre>\n\n\n\n<p>which will include the mysql.sql file for the restore, but will end up overwriting the da_admin password, so you may need to <a href=\"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/\" target=\"_blank\" rel=\"noreferrer noopener\">reset that<\/a> if it was changed.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">IMPORTANT<\/h4>\n\n\n\n<p>The DirectAdmin backup\/restores are database type\/version independent. However, these backups are not always universally interchangeable between databases. &nbsp; The User databases typically are fine, but the mysql tables in mysql.sql vary per version, so worst case you &nbsp;might not be able to (easily) restore the mysql.sql file into your database.<br><br>MySQL 5.7 uses a different password column name (replaced &#8220;password&#8221; with &#8220;authentication_string&#8221;) so restoring the mysql.user table wouldn&#8217;t work, just as one example.<br><br>When possible, use the same version of MySQL or MariaDB used to create these sql files.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before any changes, or for regular intervals, you might want to make backups of your database, which are not specific to the normal DirectAdmin User backup system. This guide will explain how to backup the .sql files on their own using CustomBuild. Backup cd \/usr\/local\/directadmin\/custombuild.\/build set mysql_backup yes.\/build mysql_backup and if you want to prevent [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[273],"tags":[],"class_list":["post-3198","post","type-post","status-publish","format-standard","hentry","category-directadmin"],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Backup SQL files with CustomBuild 2.0 | 24x7serversupport Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Backup SQL files with CustomBuild 2.0 | 24x7serversupport Blog\" \/>\n<meta property=\"og:description\" content=\"Before any changes, or for regular intervals, you might want to make backups of your database, which are not specific to the normal DirectAdmin User backup system. This guide will explain how to backup the .sql files on their own using CustomBuild. Backup cd \/usr\/local\/directadmin\/custombuild.\/build set mysql_backup yes.\/build mysql_backup and if you want to prevent [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/\" \/>\n<meta property=\"og:site_name\" content=\"24x7serversupport Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-05T23:52:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-06-06T11:32:41+00:00\" \/>\n<meta name=\"author\" content=\"24x7support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:site\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"24x7support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/\",\"name\":\"Backup SQL files with CustomBuild 2.0 | 24x7serversupport Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\"},\"datePublished\":\"2020-06-05T23:52:06+00:00\",\"dateModified\":\"2020-06-06T11:32:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.24x7serversupport.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Backup SQL files with CustomBuild 2.0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/\",\"name\":\"24x7serversupport Blog\",\"description\":\"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\",\"name\":\"24x7support\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Backup SQL files with CustomBuild 2.0 | 24x7serversupport Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/","og_locale":"en_US","og_type":"article","og_title":"Backup SQL files with CustomBuild 2.0 | 24x7serversupport Blog","og_description":"Before any changes, or for regular intervals, you might want to make backups of your database, which are not specific to the normal DirectAdmin User backup system. This guide will explain how to backup the .sql files on their own using CustomBuild. Backup cd \/usr\/local\/directadmin\/custombuild.\/build set mysql_backup yes.\/build mysql_backup and if you want to prevent [&hellip;]","og_url":"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/","og_site_name":"24x7serversupport Blog","article_published_time":"2020-06-05T23:52:06+00:00","article_modified_time":"2020-06-06T11:32:41+00:00","author":"24x7support","twitter_card":"summary_large_image","twitter_creator":"@24x7serversuppo","twitter_site":"@24x7serversuppo","twitter_misc":{"Written by":"24x7support","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/","url":"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/","name":"Backup SQL files with CustomBuild 2.0 | 24x7serversupport Blog","isPartOf":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#website"},"datePublished":"2020-06-05T23:52:06+00:00","dateModified":"2020-06-06T11:32:41+00:00","author":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401"},"breadcrumb":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.24x7serversupport.com\/blog\/backup-sql-files-with-custombuild-2-0\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.24x7serversupport.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Backup SQL files with CustomBuild 2.0"}]},{"@type":"WebSite","@id":"https:\/\/www.24x7serversupport.com\/blog\/#website","url":"https:\/\/www.24x7serversupport.com\/blog\/","name":"24x7serversupport Blog","description":"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401","name":"24x7support","url":"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/3198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/comments?post=3198"}],"version-history":[{"count":2,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/3198\/revisions"}],"predecessor-version":[{"id":3202,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/3198\/revisions\/3202"}],"wp:attachment":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/media?parent=3198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/categories?post=3198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/tags?post=3198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}