{"id":10820893,"date":"2018-10-27T06:03:29","date_gmt":"2018-10-27T06:03:29","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=helphub_article&#038;p=10820893"},"modified":"2020-11-19T02:15:24","modified_gmt":"2020-11-19T02:15:24","slug":"restoring-your-database-from-backup","status":"publish","type":"helphub_article","link":"https:\/\/ja.wordpress.org\/support\/article\/restoring-your-database-from-backup\/","title":{"rendered":"\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u304b\u3089\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5fa9\u5143"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Using phpMyAdmin<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"\/support\/article\/phpmyadmin\/\">phpMyAdmin<\/a> is a program used to manipulate databases remotely through a web interface. A good hosting package will have this included. For information on backing up your WordPress database, see <a href=\"\/support\/article\/backing-up-your-database\/\">Backing Up Your Database<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Information here has been tested using <a href=\"\/support\/article\/phpmyadmin\/\">phpMyAdmin<\/a> 4.0.5 running on Unix.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The following instructions will <strong>replace<\/strong> your current database with the backup, <strong>reverting<\/strong> your database to the state it was in when you backed up.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Restore Process<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Using phpMyAdmin, follow the steps below to restore a MySQL\/MariaDB database.<\/p>\n\n\n\n<ol><li>Login to <a href=\"\/support\/article\/phpmyadmin\/\">phpMyAdmin<\/a>.<\/li><li>Click &#8220;Databases&#8221; and select the database that you will be importing your data into.<\/li><li>You will then see either a list of tables already inside that database or a screen that says no tables exist. This depends on your setup.<\/li><li>Across the top of the screen will be a row of tabs. Click the <strong>Import<\/strong> tab.<\/li><li>On the next screen will be a location of text file box, and next to that a button named <strong>Browse<\/strong>.<\/li><li>Click <strong>Browse<\/strong>. Locate the backup file stored on your computer.<\/li><li>Make sure <strong>SQL<\/strong> is selected in the <strong>Format<\/strong> drop-down menu.<\/li><li>Click the <strong>Go<\/strong> button.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Now grab a coffee. This bit takes a while. Eventually you will see a success screen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you get an error message, your best bet is to post to the <a href=\"https:\/\/wordpress.org\/support\/\">WordPress support forums<\/a> to get help.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using MySQL\/MariaDB Commands<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The restore process consists of unarchiving your archived database dump, and importing it into your MySQL\/MariaDB database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Assuming your backup is a <code>.bz2<\/code> file, created using instructions similar to those given for <a href=\"\/support\/article\/backing-up-your-database\/#using-straight-mysqlmariadb-commands\">Backing up your database using MySQL\/MariaDB commands<\/a>, the following steps will guide you through restoring your database:<\/p>\n\n\n\n<ol><li>Unzip your <code>.bz2<\/code> file:<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">user@linux:~\/files\/blog&gt; bzip2 -d blog.bak.sql.bz2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> If your database backup was a <code>.tar.gz<\/code> file called <code>blog.bak.sql.tar.gz<\/code>, then<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">tar -zxvf blog.bak.sql.tar.gz<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">is the command that should be used instead of the above.<\/p>\n\n\n\n<ol><li>Put the backed-up SQL back into MySQL\/MariaDB:<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">user@linux:~\/files\/blog&gt; mysql -h mysqlhostserver -u mysqlusername -p databasename &lt; blog.bak.sql<br><br>Enter password: (enter your mysql password) <br>user@linux:~\/files\/blog&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using phpMyAdmin phpMyAdmin is a program used to manipulate databases remotely through a web interface. A good [&hellip;]<\/p>\n","protected":false},"author":148148,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","category":[26773,26788,26780,26790,26779],"class_list":["post-10820893","helphub_article","type-helphub_article","status-publish","hentry","category-getting-started","category-customizing","category-troubleshooting","category-maintenance","category-advanced-topics"],"revision_note":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/articles\/10820893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/articles"}],"about":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/types\/helphub_article"}],"author":[{"embeddable":true,"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/users\/148148"}],"replies":[{"embeddable":true,"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/comments?post=10820893"}],"version-history":[{"count":2,"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/articles\/10820893\/revisions"}],"predecessor-version":[{"id":11660210,"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/articles\/10820893\/revisions\/11660210"}],"wp:attachment":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=10820893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/category?post=10820893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}