{"id":1792,"date":"2012-03-03T14:03:04","date_gmt":"2012-03-03T18:03:04","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=1792"},"modified":"2013-03-20T08:44:20","modified_gmt":"2013-03-20T12:44:20","slug":"how-to-migrate-a-mysql-databasetable-from-one-server-to-another","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/how-to-migrate-a-mysql-databasetable-from-one-server-to-another","title":{"rendered":"How to migrate a Mysql database\/table from one server to another?"},"content":{"rendered":"<p>The easiest way to transfer a Mysql database from one server to another is by creating a backup, copy the mysql database backup to another server and restore it on the remote server.<\/p>\n<p>The first thing is to create a backup of the mysql database using mysqldump. It creates a backup in the .sql format. You have to use your SSH user\/password while backup\/restore of database.<\/p>\n<p>To backup a specific database:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># mysqldump -u root -p db_name &gt; db_name.sql<\/span><\/pre>\n<\/blockquote>\n<p>To backup a specific Mysql table:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># mysqldump -u root -p db_name tb_name &gt; tb_name.sql<\/span><\/pre>\n<\/blockquote>\n<p>Copy the database\/table backups to the remote server using SCP (ssh):<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># scp db_name.sql root@remote_server_ip:\/backup\/<\/span>\r\n<span style=\"color: #0000ff;\"># scp tb_name.sql root@remote_server_ip:\/backup\/<\/span><\/pre>\n<\/blockquote>\n<p>Login to the remote server and restore the .sql file. You should be in the backup directory while restoring<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># mysql -u root -p db_name &lt; db_name.sql<\/span>\r\n<span style=\"color: #0000ff;\"># mysql -u root -p db_name &lt; tb_name.sql<\/span><\/pre>\n<\/blockquote>\n<p>On a cPanel server, the mysql user is &#8216;root&#8217; and the mysql password.<br \/>\nOn a Plesk server the mysql user is &#8216;admin&#8217; and the Plesk admin password.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The easiest way to transfer a Mysql database from one server to another is by creating a backup, copy the mysql database backup to another server and restore it on the remote server.<br \/>\nThe first thing is to create a backup of the mysql database using mysqldump. It creates a backup in the .sql format. You have to use your SSH user\/password while backup\/restore of database.<br \/>\nTo backup a specific database:<\/p>\n<p># mysqldump -u root -p db_name &gt; db_name.sql<\/p>\n<p>To backup a specific Mysql table:<\/p>\n<p># mysqldump -u root -p db_name tb_name &gt; [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[111],"tags":[1361,1359,1360,1358],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1792"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=1792"}],"version-history":[{"count":4,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1792\/revisions"}],"predecessor-version":[{"id":1795,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1792\/revisions\/1795"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=1792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=1792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=1792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}