{"id":14490,"date":"2017-02-07T14:01:34","date_gmt":"2017-02-07T13:01:34","guid":{"rendered":"https:\/\/www.oderland.se\/support\/artikel\/hur-tar-jag-en-backup-av-min-databas\/"},"modified":"2026-02-13T16:31:50","modified_gmt":"2026-02-13T15:31:50","slug":"how-do-i-back-up-my-database","status":"publish","type":"ht_kb","link":"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-back-up-my-database\/","title":{"rendered":"How do I back up my database?"},"content":{"rendered":"\n<p>There are various ways to create a backup of a database, and in these instructions we describe two of the most common options.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">We automatically save backups of all data on all <a href=\"https:\/\/www.oderland.com\/web-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">web hosting accounts<\/a>, <a href=\"https:\/\/www.oderland.com\/servers\/\" target=\"_blank\" rel=\"noreferrer noopener\">Managed Servers<\/a> and <a href=\"https:\/\/www.oderland.com\/solutions\/agency\/\" target=\"_blank\" rel=\"noreferrer noopener\">Agency<\/a> services once per day via the backup tool Acronis. You may read more about the tool <a rel=\"noreferrer noopener\" href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-restore-backups-via-acronis-backup\/\" data-type=\"ht_kb\" data-id=\"9432\" target=\"_blank\">here<\/a>.<br>If you have a Managed Server and wish for us to save backups more often than once per day, <a rel=\"noreferrer noopener\" href=\"https:\/\/www.oderland.se\/support\/en\/contact-us\/\" data-type=\"page\" data-id=\"7188\" target=\"_blank\">contact us<\/a> and we&#8217;ll take it from there.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">phpMyAdmin<\/h2>\n\n\n\n<p>You can create a backup of your database by using phpMyAdmin, accessible via cPanel for your web hosting account.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Begin by <a rel=\"noreferrer noopener\" href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-login-to-cpanel\/\" data-type=\"ht_kb\" data-id=\"4236\" target=\"_blank\">logging on to cPanel<\/a>.<\/li>\n\n\n\n<li>Then click the icon <code>phpMyAdmin<\/code> under <code>Databases<\/code>.<br><a href=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2017\/05\/cpanel_icon_phpmyadmin-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"713\" height=\"193\" class=\"wp-image-24948\" style=\"width: 713px;\" src=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2017\/05\/cpanel_icon_phpmyadmin-1.png\" alt=\"\" srcset=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2017\/05\/cpanel_icon_phpmyadmin-1.png 713w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2017\/05\/cpanel_icon_phpmyadmin-1-300x81.png 300w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2017\/05\/cpanel_icon_phpmyadmin-1-50x14.png 50w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2017\/05\/cpanel_icon_phpmyadmin-1-60x16.png 60w, https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2017\/05\/cpanel_icon_phpmyadmin-1-100x27.png 100w\" sizes=\"auto, (max-width: 713px) 100vw, 713px\" \/><\/a><\/li>\n\n\n\n<li>Once you&#8217;ve entered phpMyAdmin, you will see a list of your databases to the left. Click the one you&#8217;d like to back up.<\/li>\n\n\n\n<li>Now, in the menu at the top of the page, click the tab <code>Export<\/code>.<br><a href=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2017\/02\/phpmyadmin_export_tab.png\"><img loading=\"lazy\" decoding=\"async\" width=\"278\" height=\"43\" class=\"wp-image-14498\" style=\"width: 278px;\" src=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2017\/02\/phpmyadmin_export_tab.png\" alt=\"\"><\/a><\/li>\n\n\n\n<li>Finally, select the export method you want to use, either <code>Quick<\/code> or <code>Custom<\/code>. If you do not know that you must set any specific options for the export, use <code>Quick<\/code>. You also need to choose export format; choose <code>SQL<\/code> here. Then click <code>Go<\/code> to create your backup.<br><a href=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2017\/02\/phpmyadmin_export_options.png\"><img loading=\"lazy\" decoding=\"async\" width=\"337\" height=\"262\" class=\"wp-image-14500\" style=\"width: 337px;\" src=\"https:\/\/www.oderland.se\/support\/wp-content\/uploads\/2017\/02\/phpmyadmin_export_options.png\" alt=\"\"><\/a><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">SSH<\/h2>\n\n\n\n<p>You can also create backups of your databases via SSH. To do this, firstly, you must connect to your account via SSH, and we have a set of instructions for that <a href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-connect-to-my-web-hosting-account-using-ssh\/\" data-type=\"ht_kb\" data-id=\"4832\">he<\/a><a rel=\"noreferrer noopener\" href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-connect-to-my-web-hosting-account-using-ssh\/\" data-type=\"ht_kb\" data-id=\"4832\" target=\"_blank\">r<\/a><a href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-connect-to-my-web-hosting-account-using-ssh\/\" data-type=\"ht_kb\" data-id=\"4832\">e<\/a>.<\/p>\n\n\n\n<p>Once connected via SSH, run the following command to create a backup of your database:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mariadb-dump -u username -p'password' dbname &gt; \/path\/to\/databasebackup.sql<\/pre>\n\n\n\n<p>Replace <code>username<\/code> with the database username, and <code>password<\/code> with the correct password for the database user. Also, replace <code>dbname<\/code> with the name of the database, and enter the correct path to where you want to save the backup.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-danger\">Do not save the backup file in a folder accessible via the Internet. If you do, anyone could download your database. Instead, save the database file <em>e.g.<\/em> in the document root of your account.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are various ways to create a backup of a database, and in these instructions we describe two of the most common options. phpMyAdmin You can create a backup of your database by using phpMyAdmin, accessible via cPanel for your web hosting account. SSH You can also create backups of&#8230;<\/p>\n","protected":false},"author":12,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"ht-kb-category":[194],"ht-kb-tag":[],"class_list":["post-14490","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-backup-and-restore"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/14490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/comments?post=14490"}],"version-history":[{"count":15,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/14490\/revisions"}],"predecessor-version":[{"id":24954,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/14490\/revisions\/24954"}],"wp:attachment":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/media?parent=14490"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb-category?post=14490"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=14490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}