{"id":259,"date":"2019-12-16T14:54:46","date_gmt":"2019-12-16T13:54:46","guid":{"rendered":"https:\/\/www.combell.com\/en\/help\/?post_type=ht_kb&#038;p=259"},"modified":"2022-01-07T10:55:38","modified_gmt":"2022-01-07T09:55:38","slug":"import-export-databases","status":"publish","type":"ht_kb","link":"https:\/\/www.combell.com\/en\/help\/kb\/import-export-databases\/","title":{"rendered":"Import \/ export databases"},"content":{"rendered":"\n<p><span style=\"vertical-align: inherit;\">You can export or import your database via phpMyAdmin or via a terminal (if your SSH is active).<\/span><\/p>\n\n\n\n<div class=\"wp-block-ht-block-toc  is-style-outline htoc htoc--position-wide toc-list-style-plain\" data-htoc-state=\"expanded\"><span class=\"htoc__title\"><span class=\"ht_toc_title\">IN THIS ARTICLE<\/span><span class=\"htoc__toggle\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"16\" height=\"16\"><g fill=\"#444\"><path d=\"M15 7H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z\"><\/path><path d=\"M15 1H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1zM15 13H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z\"><\/path><\/g><\/svg><\/span><\/span><div class=\"htoc__itemswrap\"><ul class=\"ht_toc_list\"><li class=\"\"><a href=\"#phpmyadmin\">Export \/ import database via phpMYadmin<\/a><ul class=\"ht_toc_child_list\"><\/ul><\/li><li class=\"\"><a href=\"#terminal\">Export\/import database via Terminal<\/a><ul class=\"ht_toc_child_list\"><\/ul><\/li><\/ul><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"phpmyadmin\"><span style=\"vertical-align: inherit;\">Export \/ import database via phpMYadmin<\/span><\/h2>\n\n\n\n<p><span style=\"vertical-align: inherit;\">You can open phpMyAdmin via the control panel. <\/span><a href=\"https:\/\/www.combell.com\/en\/help\/kb\/how-do-i-open-phpmyadmin\/\"><span style=\"vertical-align: inherit;\">View our step-by-step plan<\/span><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"htoc-export-database-in-phpmyadmin\"><span style=\"vertical-align: inherit;\">Export database in phpMyAdmin<\/span><\/h3>\n\n\n\n<ol><li><span style=\"vertical-align: inherit;\">Select the name of the database at the very top left of the margin. This takes the form ID &lt;customer number&gt; _ database name, for example: ID132956_wordpress.<\/span><\/li><li><span style=\"vertical-align: inherit;\">Go to the horizontal menu at the top. Click on the &#8220;Export&#8221; button.<\/span><\/li><li><span style=\"vertical-align: inherit;\">The export method (&#8220;Fast&#8221;) and the export format (&#8220;SQL&#8221;) are set correctly by default normally (see image).<\/span><\/li><li><span style=\"vertical-align: inherit;\">Click on the &#8220;Start&#8221; button to confirm. A .sql file will be downloaded to your computer.<\/span><\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/2019\/12\/phpMyAdmin-EN-1.png\" alt=\"Export method\" class=\"wp-image-7417\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"htoc-import-database-into-phpmyadmin\"><span style=\"vertical-align: inherit;\">Import database into phpMyAdmin<\/span><\/h3>\n\n\n\n<ol><li><span style=\"vertical-align: inherit;\">Go to the horizontal menu at the top. Click on the &#8220;Import&#8221; button.<\/span><\/li><li><span style=\"vertical-align: inherit;\">Click on the &#8220;Choose File&#8221; button and browse your device for the desired .sql file (see image).<\/span><\/li><li><span style=\"vertical-align: inherit;\">Click on the &#8220;Start&#8221; button at the bottom to confirm the import.<\/span><\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.combell.com\/en\/help\/wp-content\/uploads\/2019\/12\/phpMyAdmin-EN-2.png\" alt=\"File to import\" class=\"wp-image-7418\"\/><\/figure>\n\n\n\n<p><span style=\"vertical-align: inherit;\">    \t\t<div class=\"hts-messages hts-messages--info  hts-messages--withtitle hts-messages--withicon \"   >\r\n    \t\t\t<span class=\"hts-messages__title\">TIP: if you are importing a complete database, the database into which you are going to import the .sql file must be empty.<\/span>    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\t If, for example, you want to restore a backup of your database, first clear the database by checking all tables in PhpMyAdmin and choosing below for the &#8220;drop&#8221; action with the selected tables. Repeat this as often as necessary until all tables are gone. Afterwards you can import the .sql file.     \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"terminal\"><span style=\"vertical-align: inherit;\">Export\/import database via Terminal<\/span><\/h2>\n\n\n\n<p><span style=\"vertical-align: inherit;\">You can also import\/export your database via a Terminal. For this you first have to check if <\/span><a href=\"https:\/\/www.combell.com\/en\/help\/kb\/activate-ssh-on-your-hosting-package\/\"><span style=\"vertical-align: inherit;\">SSH is active<\/span><\/a><span style=\"vertical-align: inherit;\"> and you can easily register &#8211; preferably via your <\/span><a href=\"https:\/\/www.combell.com\/en\/help\/kb\/create-an-ssh-key-to-log-in-to-your-hosting-via-ssh-without-a-password\/\"><span style=\"vertical-align: inherit;\">SSH key<\/span><\/a><span style=\"vertical-align: inherit;\"> .<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"htoc-export-database-via-terminal\"><span style=\"vertical-align: inherit;\">Export database via Terminal<\/span><\/h3>\n\n\n\n<p><span style=\"vertical-align: inherit;\">To export your database via the Terminal or Windows SSH client, connect to the server and execute the command below, where:<\/span><\/p>\n\n\n\n<ul><li><span style=\"vertical-align: inherit;\">HOST: your database must be host<\/span><\/li><li><span style=\"vertical-align: inherit;\">USER: your username is from the database<\/span><\/li><li><span style=\"vertical-align: inherit;\">PASS: your password is from the database<\/span><\/li><li><span style=\"vertical-align: inherit;\">NAME: the name is of the database<\/span><\/li><li><span style=\"vertical-align: inherit;\">DUMP.SQL: the name that you want to give the file<\/span><\/li><\/ul>\n\n\n\n<p><span style=\"vertical-align: inherit;\">Command:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysqldump -hHOST -uUSER \u2013p'PASS\u2019 NAME &gt; DUMP.SQL<\/code><\/pre>\n\n\n\n<p><span style=\"vertical-align: inherit;\">Example:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysqldump \u2013hmysql111.hosting.webhosting.be -uID111111_sufix \u2013p'$tr0ngPa$word' ID111111_sufix &gt; dump.sql<\/code><\/pre>\n\n\n\n<p><span style=\"vertical-align: inherit;\">    \t\t<div class=\"hts-messages hts-messages--info  hts-messages--withtitle hts-messages--withicon \"   >\r\n    \t\t\t<span class=\"hts-messages__title\">Tip: The file will be saved in the folder where you execute the command.<\/span>    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t You can add the file to an internal \/ www \/ folder and then download it through your browser. If you do the latter, you should certainly not forget to delete that file as soon as possible afterwards, because there is a danger that you will give others access to your data. [\/ Ht_message]<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"htoc-import-database-via-terminal\"><span style=\"vertical-align: inherit;\">Import database via Terminal<\/span><\/h3>\n\n\n\n<p><span style=\"vertical-align: inherit;\">To import your database via the Terminal or Windows SSH client, connect to the server and execute the command below, where:<\/span><\/p>\n\n\n\n<ul><li><span style=\"vertical-align: inherit;\">HOST: your database must be host<\/span><\/li><li><span style=\"vertical-align: inherit;\">USER: your username is from the database<\/span><\/li><li><span style=\"vertical-align: inherit;\">PASS: your password is from the database<\/span><\/li><li><span style=\"vertical-align: inherit;\">NAME: the name is of the database<\/span><\/li><li><span style=\"vertical-align: inherit;\">DUMP.SQL: the name of the file that you want to import<\/span><\/li><\/ul>\n\n\n\n<p><span style=\"vertical-align: inherit;\">Command:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -hHOST -uUSER \u2013p\u2019PASS\u2019 NAME &lt; DUMP.SQL\n<\/code><\/pre>\n\n\n\n<p><span style=\"vertical-align: inherit;\">Example:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code col-md-8\"><code>mysql \u2013hmysql111.hosting.webhosting.be -uID111111_sufix \u2013p'$tr0ngPa$word' ID111111_sufix &lt; dump.sql<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You can export or import your database via phpMyAdmin or via a terminal (if your SSH is active). Export \/ import database via phpMYadmin You can open phpMyAdmin via the control panel. View our step-by-step plan Export database in phpMyAdmin Select the name of the database at the very top&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[23,4,43],"ht-kb-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb\/259"}],"collection":[{"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/comments?post=259"}],"version-history":[{"count":17,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb\/259\/revisions"}],"predecessor-version":[{"id":3752,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb\/259\/revisions\/3752"}],"wp:attachment":[{"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/media?parent=259"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb-category?post=259"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.combell.com\/en\/help\/wp-json\/wp\/v2\/ht-kb-tag?post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}