<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WordPressカスタマイズメモ &#187; バックアップ</title>
	<atom:link href="http://wordpress.tok3.org/gyaku/foradmin/backup/feed/" rel="self" type="application/rss+xml" />
	<link>http://wordpress.tok3.org</link>
	<description>Wordpressを弄りたいときの覚え書き、検証したことのまとめ</description>
	<lastBuildDate>Tue, 12 May 2015 05:18:03 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>WordPressでBackWPupによる、バックアップ復元作業の流れ</title>
		<link>http://wordpress.tok3.org/gyaku/foradmin/backup/backwpup/</link>
		<comments>http://wordpress.tok3.org/gyaku/foradmin/backup/backwpup/#comments</comments>
		<pubDate>Mon, 05 May 2014 12:42:57 +0000</pubDate>
		<dc:creator>kana109</dc:creator>
				<category><![CDATA[バックアップ]]></category>
		<category><![CDATA[管理側ユーティリティ]]></category>

		<guid isPermaLink="false">http://wordpress.tok3.org/?p=2168</guid>
		<description><![CDATA[＜リストア方法＞ BackWPupによる、バックアップ復元作業の流れ ※リストアを行う前に、予めリストア先のサーバーを契約・用意、Wordpressをインストールしておく必要があります。 手順は⇒リストア①リストア先のサ [...]]]></description>
			<content:encoded><![CDATA[<p><strong>＜リストア方法＞</strong></p>
<p>BackWPupによる、バックアップ復元作業の流れ</p>
<p>※リストアを行う前に、予めリストア先のサーバーを契約・用意、Wordpressをインストールしておく必要があります。</p>
<p>手順は<a href="http://wordpress.tok3.org/usermanual/lolipop/" target="_blank">⇒リストア①リストア先のサーバーを契約・用意（ロリポップ）〜WPインストール</a></p>
<p><strong>①バックアップしたデータをDropboxからダウンロードする。</strong><br />
<strong> ②バックアップデータの解凍</strong><br />
<strong> ③サーバー上のファイルの復元（FTPアップロード）</strong><br />
<strong> ④データベースの復元（データベースのインポート）</strong><br />
<strong> ⑤プラグインの再インストール<br />
⑥記事の復元</strong><br />
<strong>⑦動作確認</strong><br />
<strong> バックアップ設定</strong><br />
ーーーーーーーーーーーー<br />
<strong>動画マニュアル</strong></p>
<p>&nbsp;</p>
<p><a rel="attachment wp-att-2893" href="http://wordpress.tok3.org/usermanual/restore/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-15-17-53-42%ef%bc%89/"><img class="aligncenter size-full wp-image-2893" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/210d93f40c24e6e53ea40158f85add71.png" alt="" width="243" height="187" /></a></p>
<h4>①-バックアップしたデータをDropboxからダウンロードする。</h4>
<p>BackWPupの最新版バックアップデータを、Dropboxから自分のPCにダウンロードして下さい。<br />
バックアップした最新データは、毎日、早朝にDropboxのフォルダへ自動的に保存されるようい設定されていると仮定します。</p>
<p>Dropboxへログインします。</p>
<p>&nbsp;</p>
<p><a rel="attachment wp-att-3270" href="http://wordpress.tok3.org/usermanual/restore2-b/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-27-6-42-41%ef%bc%89/"></a><a rel="attachment wp-att-3269" href="http://wordpress.tok3.org/usermanual/restore2-b/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-27-6-42-50%ef%bc%89/"><img class="aligncenter size-large wp-image-3269" title="スクリーンショット（2014-06-27 6.42.50）" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/52057786a929f2dec6efade13ba64fae-1024x318.png" alt="" width="700" height="217" /></a></p>
<p>&nbsp;</p>
<p>フォルダにあるzipファイルをローカルへダウンロードしてください。</p>
<p><a rel="attachment wp-att-3258" href="http://wordpress.tok3.org/usermanual/restore2-b/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-26-17-13-35%ef%bc%89/"></a></p>
<h4>②バックアップデータの解凍</h4>
<p>バックアップデータをダウンロードすると、&#8221;backwpup_xxxxxxxxx.tar.gz&#8221;という圧縮ファイルが現れます。<br />
ダブルクリックして解凍します。</p>
<p><a rel="attachment wp-att-2892" href="http://wordpress.tok3.org/usermanual/restore/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-15-17-36-57%ef%bc%89/"><img class="aligncenter size-large wp-image-2892" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/85f7fafa999091b2ec40fbc64972f28b-1024x410.png" alt="" width="700" height="280" /></a>解凍すると、このようなファイルが内包されています。それぞれの役割は、以下のようになります。</p>
<blockquote>
<ul>
<li>backwpup_readme.txt　：不要</li>
<li>xxxxxxxxx日付.txt 　：プラグインリストです。</li>
<li>xxxxxxxxx日付.xml　：記事やWordPressサイトの構成を記述してあります。</li>
<li>manifest.json　：不要</li>
<li>データベース名.sql 　：データベースの中身です。</li>
<li>backwpup_readme.txt</li>
<li>functions.php</li>
<li> <span style="color: #ff0000;">img/</span></li>
<li> index.php</li>
<li> <span style="color: #ff0000;">script/</span></li>
<li> sitemap.xml</li>
<li> sitemap.xml.gz</li>
<li> wp-activate.php</li>
<li> wp-blog-header.php</li>
<li> wp-comments-post.php</li>
<li> wp-config.php</li>
<li><span style="color: #ff0000;">wp-content/</span></li>
<li> wp-cron.php</li>
<li> wp-links-opml.php</li>
<li> wp-load.php</li>
<li> wp-login.php</li>
<li> wp-mail.php</li>
<li>wp-settings.php</li>
<li> wp-signup.php</li>
<li> wp-trackback.php</li>
<li>xmlrpc.php</li>
</ul>
</blockquote>
<h4>③サーバー上のファイルの復元（FTPアップロード）</h4>
<p><a rel="attachment wp-att-2905" href="http://wordpress.tok3.org/usermanual/restore/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-15-18-27-05%ef%bc%89/"><img class="aligncenter size-full wp-image-2905" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/6e1bf67b34dd347febaa6ca9b853310a.png" alt="" width="348" height="142" /></a><br />
「<span style="color: #ff0000;">/wp-content</span>」のフォルダをFTPでアップロードして上書きして下さい。<br />
尚、バックアップデータの中には、「<span style="color: #ff0000;">/wp-content</span>」フォルダ以外のファイルも含まれていますが、「<span style="color: #ff0000;">/wp-content</span>」フォルダと、以下のフォルダ以外は上書きしないで下さい。もし、カスタマイズしたファイルがあれば、そのファイルのみ上書きしましょう。</p>
<p>・テーマ用画像ファイルのパス：　/img/（以下全て）。<br />
・スクリプト　/script/</p>
<h4>④データベースの復元（データベースのインポート）</h4>
<p>データベースのインポート（データベースを取り込む）は、データベース管理ツールのphpMyAdminを利用します。</p>
<p>バックアップの圧縮ファイルを解凍すると、SQLファイルがあります。拡張子が「.sql」のファイルです。このファイルがデータベースの中身です。このファイルをphpMyAdminを利用してインポートします。<br />
phpMyAdmin（Ver.2.11の場合）<br />
phpMyAdminにログインし、「インポート」をクリックして下さい。</p>
<p>・phpMyAdminへログインする方法：レンタルサーバー会社によって異なります。<br />
〜さくらレンタルサーバーの場合〜</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-2913" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/ff364ac868e6985091de4e9de44eb2cb.png" alt="" width="558" height="514" /> 1）サーバーコントロールパネルログイン画面から、ログインします。</p>
<p><img class="aligncenter size-full wp-image-2917" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/34d7d125371355aa5e84c9e63ebbf92c.png" alt="" width="253" height="177" /></p>
<p>2)左サイドメニューから、「データベースの設定」画面を開きます。</p>
<p><a rel="attachment wp-att-2921" href="http://wordpress.tok3.org/usermanual/restore/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-15-18-34-52%ef%bc%89-2/"><img class="aligncenter size-full wp-image-2921" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/159f7ae998ac119b76606761e8b07daa1.png" alt="" width="572" height="906" /></a>「管理ツールログイン」 リンクをクリックします。</p>
<p><a rel="attachment wp-att-2911" href="http://wordpress.tok3.org/?attachment_id=2911"></a><a rel="attachment wp-att-2915" href="http://wordpress.tok3.org/usermanual/restore/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-15-18-36-13%ef%bc%89/"></a><a rel="attachment wp-att-2916" href="http://wordpress.tok3.org/usermanual/restore/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-15-18-34-52%ef%bc%89/"></a></p>
<p><a rel="attachment wp-att-2916" href="http://wordpress.tok3.org/usermanual/restore/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-15-18-34-52%ef%bc%89/"><img class="aligncenter size-large wp-image-2915" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/cfa800b876cb7a17b72fc6f3c1ae52f0-1024x466.png" alt="" width="700" height="318" /></a></p>
<p>3)phpMyAdmin画面が開きます。「インポート」タブをクリックします。</p>
<p><a rel="attachment wp-att-2916" href="http://wordpress.tok3.org/usermanual/restore/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-15-18-34-52%ef%bc%89/"> </a></p>
<p><img class="aligncenter size-full wp-image-2914" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/c6d0fed8b157aec291935963f0384f351.png" alt="" width="925" height="199" /></p>
<p>4)「インポート」画面を開き、「インポートするファイル」枠内の「ファイルを選択」ボタンをクリックし、<br />
バックアップされたsqlファイルを選択、アップロードします。</p>
<p>sqlのインポートを行い、トップページが元のサイトと同じように表示されるようになりました。</p>
<p>しかし、リンクをクリックしたり、管理画面にアクセスしてみると、元のサイトのurlへジャンプしてしまいます。これでは、管理画面に入れないので困ります。</p>
<p>phpMyAdminを開き、インポートしたsqlファイルの、&#8221;wp_options&#8221;テーブルの、option_value &#8220;<a href="http://nagano-outdoor.com&#8221;を、新たなurlへと編集します。" rel="nofollow">http://nagano-outdoor.com&#8221;を、新たなurlへと編集します。</a></p>
<p>ここでは、&#8221;<a href="http://testboat.lolipop.jp&#8221;にしました。" rel="nofollow">http://testboat.lolipop.jp&#8221;にしました。</a></p>
<p><img class="alignnone size-full wp-image-3173" style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; font-style: normal; font-variant: normal; line-height: 19px;" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/e51ab7aa59df3d6c88c2c75d66524214.png" alt="" width="790" height="641" /></p>
<p>再び、管理画面にアクセスしてみると、新しいサイトのURLに置き換わっています。<br />
ログインします。元の管理画面のログイン名と、パスワードを使用するようになっています。</p>
<p>Webサイトを表示させてみると、所々リンク切れの箇所があります。</p>
<p><a rel="attachment wp-att-3168" href="http://wordpress.tok3.org/usermanual/restore/attachment/permlink/"><img class="alignnone size-medium wp-image-3168" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/permlink-300x200.png" alt="" width="300" height="200" /></a></p>
<p><a rel="attachment wp-att-3168" href="http://wordpress.tok3.org/usermanual/restore/attachment/permlink/"></a>設定＞パーマリンク設定　で、「変更を保存」し、</p>
<p><img class="alignnone size-full wp-image-3167" style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; font-style: normal; font-variant: normal; line-height: 19px;" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/mod_rewrite.png" alt="" width="283" height="174" /></p>
<p>.htaccess　に　mod_rewriteを記述してサーバーへアップロードします。<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: x-small;"><br />
</span><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: x-small;"><br />
</span>あと、グローバルナビが元のサイトのリンクになっていたりします。</p>
<p><a rel="attachment wp-att-3169" href="http://wordpress.tok3.org/usermanual/restore/attachment/search_regex/"><img class="alignnone size-large wp-image-3169" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/search_regex-1024x648.png" alt="" width="700" height="442" /></a></p>
<p><a rel="attachment wp-att-3169" href="http://wordpress.tok3.org/usermanual/restore/attachment/search_regex/"></a>記事内のリンクURLを直す。</p>
<p>「search regex」プラグイン記事内の画像リンクが絶対パスで指定されてい場合が多くあるので、<br />
プラグイン「Search Regex」を使って一括置換してあげましょう。</p>
<p>プラグイン：Search Regex<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: x-small;"><br />
</span>※「Regex」にチェックを入れる事で正規表現が使えます。</p>
<p><strong>WordPressのドメイン設定の変更</strong><br />
<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: x-small;"><br />
</span>ネームサーバーの変更前まで、移行後のサーバーに一時的にアクセス可能な仮のドメインやIPアドレスでアクセスしている場合、ネームサーバーの変更後、正しいドメインでアクセスするためにデータベースの記述変更が必要です。</p>
<p>データベース管理ツール「phpMyAdmin」で、以下の手順でSQLを実行します。</p>
<p>1) サーバーの管理画面から、phpMyAdminへログインしWordPressで使用しているデータベース上でSQLが実行できる状態にします。</p>
<p>2) 既に読み込んだSQLで、さらに以下のSQLを入力して実行します。「SQL」タブを開き、</p>
<p><strong>・ サイトのドメイン(URL)の変更<br />
<a rel="attachment wp-att-3188" href="http://wordpress.tok3.org/usermanual/restore/attachment/1/"><img class="aligncenter size-large wp-image-3188" title="1" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/1-1024x471.png" alt="" width="700" height="321" /></a></strong>UPDATE wp_options SET option_value =REPLACE (option_value, &#8216;変更前のURL&#8217;, &#8216;変更後のURL&#8217;)WHERE option_name = &#8216;home&#8217; OR option_name = &#8216;siteurl&#8217;;</p>
<p><strong>・ 記事のパーマリンク(guid)の変更<br />
</strong><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: x-small;"><a rel="attachment wp-att-3183" href="http://wordpress.tok3.org/usermanual/restore/attachment/2/"><img class="aligncenter size-large wp-image-3183" title="2" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/2-1024x582.png" alt="" width="700" height="397" /></a> </span>[html]UPDATE wp_posts SET guid =REPLACE (guid, &#8216;変更前のURL&#8217;, &#8216;変更後のURL&#8217;);[/html]</p>
<p><strong>・ 記事内のURLの変更</strong></p>
<p><a rel="attachment wp-att-3189" href="http://wordpress.tok3.org/usermanual/restore/attachment/3-2/"><img class="aligncenter size-large wp-image-3189" title="3" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/31-1024x593.png" alt="" width="700" height="405" /></a>[html]UPDATE wp_posts SET post_content =REPLACE  (post_content, &#8216;変更前のURL&#8217;, &#8216;変更後のURL&#8217;);[/html]</p>
<p><strong>・ 画像のパスの変更</strong></p>
<p><a rel="attachment wp-att-3190" href="http://wordpress.tok3.org/usermanual/restore/attachment/4-3/"><img class="aligncenter size-large wp-image-3190" title="4" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/41-1024x577.png" alt="" width="700" height="394" /></a>[html]UPDATE wp_posts SET post_content =REPLACE (post_content, &#8216;src=&#8221;変更前のURL&#8217;, &#8216;src=&#8221;変更後のURL&#8217;);UPDATE wp_posts SET  guid =REPLACE (guid, &#8216;変更前のURL&#8217;, &#8216;変更後のURL&#8217;)WHERE post_type = &#8216;attachment&#8217;;[/html]</p>
<p><strong>・ 各投稿のメタ情報の変更</strong></p>
<p><a rel="attachment wp-att-3191" href="http://wordpress.tok3.org/usermanual/restore/attachment/5-2/"><img class="aligncenter size-large wp-image-3191" title="5" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/51-1024x677.png" alt="" width="700" height="462" /></a>[html]UPDATE wp_postmeta SET meta_value =REPLACE (meta_value, &#8216;変更前のURL&#8217;,'変更後のURL&#8217;);[/html]</p>
<h4>⑤プラグインの再インストール</h4>
<p>BackWPupの管理画面でジョブを登録する際に「Installed plugins list」にチェックを入れておくと、現在インストールされているプラグインの一覧がテキスト形式で出力されます。</p>
<p>ローカルに保存されている/wp-content/plugins/以下のファイルを全て、サーバーへアップします。<br />
「プラグイン」画面から、全てのプラグインを<strong>一つずつ</strong>「有効化」します。<br />
※一つずつ有効化しないと、プラグインとWordPressのバージョンやPHPのバージョンの互換性の問題でエラーが怒る可能性があります。</p>
<h4>⑥記事の復元</h4>
<p>「ツール＞インポート」画面から、.xmlファイルをインポートします。</p>
<p><img class="aligncenter size-full wp-image-3116" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/878a526bdb0bdb2d720c4087822a79c4.png" alt="" width="797" height="425" /><a rel="attachment wp-att-3115" href="http://wordpress.tok3.org/usermanual/restore/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-19-18-01-40%ef%bc%89/"><img class="aligncenter size-full wp-image-3115" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/26d404d956e7cb2eb1a7526dc5ac10cc.png" alt="" width="812" height="421" /></a> 前提として、デフォルトでアップロードの上限が2MBと設定されているのを、変更しておく必要があります。<br />
<a href="/file_max/">⇒上限を変更する方法</a></p>
<p><a rel="attachment wp-att-3097" href="http://wordpress.tok3.org/usermanual/restore/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-19-17-00-56%ef%bc%89/"></a></p>
<h4>⑥-9. カスタムフィールドテンプレート</h4>
<p>「Custom Fields Template」プラグインを有効にした後、カスタムフィールドテンプレートがきちんと入力されているか、また、各記事の詳細情報が表示されるか、確認する。</p>
<h4>⑦動作確認</h4>
<p><a rel="attachment wp-att-2926" href="http://wordpress.tok3.org/usermanual/restore/attachment/%e3%82%b9%e3%82%af%e3%83%aa%e3%83%bc%e3%83%b3%e3%82%b7%e3%83%a7%e3%83%83%e3%83%88%ef%bc%882014-06-15-18-59-19%ef%bc%89/"><img class="aligncenter size-full wp-image-2926" src="http://wordpress.tok3.org/wp-content/uploads/2014/06/fbc1b3aa6c72e0bba370b93daeef749c.png" alt="" width="944" height="977" /></a> これでバックアップデータからの復元作業は完了です。WebブラウザでWebサイトにアクセスして確認して下さい。</p>]]></content:encoded>
			<wfw:commentRss>http://wordpress.tok3.org/gyaku/foradmin/backup/backwpup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
