{"id":5999,"date":"2013-05-16T07:57:21","date_gmt":"2013-05-16T13:57:21","guid":{"rendered":"http:\/\/sanuja.com\/blog\/?p=5999"},"modified":"2020-05-29T18:00:12","modified_gmt":"2020-05-30T00:00:12","slug":"export-and-import-sql-databases","status":"publish","type":"post","link":"https:\/\/sanuja.com\/blog\/export-and-import-sql-databases","title":{"rendered":"Export and import SQL databases"},"content":{"rendered":"<p>Migrating SQL\/MySQL databases from one location to another is not something most of you will do. There are circumstances where migrating a database from the administration side of a server is easier than trying to manually copy data. If you change your web host (or server) after creating databases in the current location or if you wanted to back up your database files manually, then it is essential to know the fundamentals of migration.<\/p>\n<p><!--more--><br \/>\n<a href=\"#skip\" class=\"button skip-tech-jargon\">Skip Tech Jargon<\/a><\/p>\n<h2>Background<\/h2>\n<p>SQL\/MySQL databases are like MS Excel spreadsheets or MS Access files. The only difference is these databases run on a web (or internal) server as oppose to running on a local computer. Fundamentally they are similar in operation, but differ in how they process and store data. The MS Excel is one of many low level database program. The MS Access is step up from Excel with much more advanced functions. The SQL\/MySQL databases are much more advanced and extremely flexible than the previous products.<\/p>\n<p>The flexibility of SQL\/MySQL can be summarized&#8230;<\/p>\n<ul>\n<li> They will run most (as far as I know, all) operating systems.<\/li>\n<li> The deployment and distribution management is very flexible.<\/li>\n<li> They have the ability to run several databases while communicating between them.<\/li>\n<li> Easy universal database migration options (no proprietary files).<\/li>\n<\/ul>\n<h2 id=\"skip\">Migration<\/h2>\n<p>For this example, I used phpMyAdmin program installed on a Linux server. This particular example involves in transferring databases of mTouch WP plugin data from one location to another. You can use the exact same steps to migrate SQL\/MySQL databases in phpMyAdmin. If you you a different program for database management, it should be similar to phpMyAdmin, but be careful of how you export it.<\/p>\n<p><font color=\"#ff0000\"><b>This is for advanced users ONLY. A mistake can take <u>down your entire website<\/u>. Use the guide at your own discretion.<\/b><\/font><\/p>\n<p>1. Make sure your program\/plugin\/add-on is upto date.<\/p>\n<p>2. Log into your server and then phpMyAdmin.<\/p>\n<p>3. Choose the database location from the left pane of the phpMyAdmin window.<br \/>\n<figure id=\"attachment_6000\" aria-describedby=\"caption-attachment-6000\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" data-attachment-id=\"6000\" data-permalink=\"https:\/\/sanuja.com\/blog\/export-and-import-sql-databases\/pma_choose\" data-orig-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_choose.jpg\" data-orig-size=\"600,338\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"pma_choose\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Choose the database location from left pane.&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_choose-300x169.jpg\" data-large-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_choose.jpg\" src=\"http:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_choose.jpg\" alt=\"Choose the database location from left pane.\" width=\"600\" height=\"338\" class=\"size-full wp-image-6000\" srcset=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_choose.jpg 600w, https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_choose-300x169.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><figcaption id=\"caption-attachment-6000\" class=\"wp-caption-text\">Choose the database location from left pane.<\/figcaption><\/figure><\/p>\n<p>3. Select the database related to your program. It is better if you export and import all databases used by the program. Then go to Export.<br \/>\n<figure id=\"attachment_6001\" aria-describedby=\"caption-attachment-6001\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" data-attachment-id=\"6001\" data-permalink=\"https:\/\/sanuja.com\/blog\/export-and-import-sql-databases\/pma_export\" data-orig-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_export.jpg\" data-orig-size=\"600,392\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"pma_export\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Select specific files for export.&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_export-300x196.jpg\" data-large-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_export.jpg\" src=\"http:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_export.jpg\" alt=\"Select specific files for export.\" width=\"600\" height=\"392\" class=\"size-full wp-image-6001\" srcset=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_export.jpg 600w, https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_export-300x196.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><figcaption id=\"caption-attachment-6001\" class=\"wp-caption-text\">Select specific files for export.<\/figcaption><\/figure><\/p>\n<p>4. Choose the export settings appropriately. As long as you will be using the same phpMyAdmin at the new location, it should not matter which format you save export the files.<br \/>\n<figure id=\"attachment_6002\" aria-describedby=\"caption-attachment-6002\" style=\"width: 528px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" data-attachment-id=\"6002\" data-permalink=\"https:\/\/sanuja.com\/blog\/export-and-import-sql-databases\/pma_import\" data-orig-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_import.jpg\" data-orig-size=\"528,695\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"pma_import\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Choose the configuration for import.&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_import-227x300.jpg\" data-large-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_import.jpg\" src=\"http:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_import.jpg\" alt=\"Choose the configuration for import.\" width=\"528\" height=\"695\" class=\"size-full wp-image-6002\" srcset=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_import.jpg 528w, https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_import-227x300.jpg 227w\" sizes=\"(max-width: 528px) 100vw, 528px\" \/><figcaption id=\"caption-attachment-6002\" class=\"wp-caption-text\">Choose the configuration for import.<\/figcaption><\/figure><\/p>\n<p>5. Log into the new server\/location and install the save exact software. It is highly recommended using the exact same software version as the one you are migrating from.<\/p>\n<p>6. Long into the phpMyAdmin (new location) and find the location of the databases on the left pane of phpMyAdmin window.<\/p>\n<p>7. Backup the new databases created by the program by exporting them (same as above). Then upload and install the old files using import pane.<\/p>\n<p>8. Validate the install by going into the front end. If you have done everything right, you should be able to now have the database up and running.<\/p>\n<p>It is as simple as that. Backups are very important so never ever skip backups before and during modifications.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Migrating SQL\/MySQL databases from one location to another is not something most of you will do. There are circumstances where migrating a database from the administration side of a server is easier than trying to manually copy data. If you change your web host (or server) after creating databases in the current location or if &hellip; <a href=\"https:\/\/sanuja.com\/blog\/export-and-import-sql-databases\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Export and import SQL databases<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":6001,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,34],"tags":[7,30,19],"class_list":["post-5999","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computer-science","category-cms","tag-server","tag-sql","tag-tutorials"],"jetpack_featured_media_url":"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2013\/05\/pma_export.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/posts\/5999","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/comments?post=5999"}],"version-history":[{"count":0,"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/posts\/5999\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/media\/6001"}],"wp:attachment":[{"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/media?parent=5999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/categories?post=5999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/tags?post=5999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}