{"id":899,"date":"2021-10-17T08:54:30","date_gmt":"2021-10-17T08:54:30","guid":{"rendered":"http:\/\/camilalui.com\/?p=899"},"modified":"2021-10-17T09:02:46","modified_gmt":"2021-10-17T09:02:46","slug":"how-to-migrate-a-wordpress-mysql-database","status":"publish","type":"post","link":"https:\/\/camilalui.com\/?p=899","title":{"rendered":"How to Migrate a WordPress MySQL Database"},"content":{"rendered":"<p>I very often have to migrate MySQL Databases as I like to spend some time playing with WordPress. So here is an easy and quick way to migrate your DB and avoid manual work when moving a blog from different providers\/servers.<\/p>\n<h3>Pre-Requisites<\/h3>\n<ul>\n<li>You must have a pre-configured MySQL server, database and user already created in the destination(new) server<\/li>\n<li>You can either use command line or PHPMyAdmin if you have available in the source server<\/li>\n<li>Don\u00b4t forget to backup your wordpress files\/images<\/li>\n<\/ul>\n<h3>From PHPMyAdmin<\/h3>\n<p>1. Access your DB<\/p>\n<p>2. Navigate to Export -&gt; Select \u00a8Quick&#8221; and \u00a8Go\u00a8<\/p>\n<p>3. You will have a .sql file downloaded<\/p>\n<h3>From Command Line<\/h3>\n<p>1. Access your server where you are migrating from<\/p>\n<p>2. Create WordPress database backup<\/p>\n<div class=\"my-syntax-highlighter\">\n<pre><textarea id=\"mshighlighter\" class=\"mshighlighter\" language=\"shell\" name=\"mshighlighter\" >mysqldump -u [user] -p [database_name] &gt; your_backup_name.sql<\/textarea><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>3. Create WordPress files backup<\/p>\n<div class=\"my-syntax-highlighter\">\n<pre><textarea id=\"mshighlighter\" class=\"mshighlighter\" language=\"shell\" name=\"mshighlighter\" >tar -zcvf your_file_name.tar.gz \/target\/directory<\/textarea><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>4. Restore WordPress DB on the new server<\/p>\n<div class=\"my-syntax-highlighter\">\n<pre><textarea id=\"mshighlighter\" class=\"mshighlighter\" language=\"shell\" name=\"mshighlighter\" >mysql -u [user] -p [database_name]<\/textarea><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>5. Restore WordPress files on the new server<\/p>\n<div class=\"my-syntax-highlighter\">\n<pre><textarea id=\"mshighlighter\" class=\"mshighlighter\" language=\"shell\" name=\"mshighlighter\" >tar -zxvf [archive_name].tar.gz --directory [target_directory]<\/textarea><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I very often have to migrate MySQL Databases as I like to spend some time playing with WordPress. So here is an easy and quick way to migrate your DB and avoid manual work when moving a blog from different providers\/servers. Pre-Requisites You must have a pre-configured MySQL server, database and user already created in<a class=\"more-link\" href=\"https:\/\/camilalui.com\/?p=899\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"jetpack_post_was_ever_published":false,"_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":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_tec_slr_enabled":"","_tec_slr_layout":""},"categories":[33,30,27,37],"tags":[],"class_list":["post-899","post","type-post","status-publish","format-standard","hentry","category-database","category-linux","category-ubuntu","category-wordpress"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9toiJ-ev","jetpack_likes_enabled":true,"jetpack-related-posts":[],"ticketed":false,"_links":{"self":[{"href":"https:\/\/camilalui.com\/index.php?rest_route=\/wp\/v2\/posts\/899","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/camilalui.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/camilalui.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/camilalui.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/camilalui.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=899"}],"version-history":[{"count":6,"href":"https:\/\/camilalui.com\/index.php?rest_route=\/wp\/v2\/posts\/899\/revisions"}],"predecessor-version":[{"id":906,"href":"https:\/\/camilalui.com\/index.php?rest_route=\/wp\/v2\/posts\/899\/revisions\/906"}],"wp:attachment":[{"href":"https:\/\/camilalui.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/camilalui.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/camilalui.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}