Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPressをローカルサーバーからライブサイトに移動する方法(2つの方法)

WordPressユーザーの多くは、コンピューター上のローカルサーバーを使用してサイトで作業することを好みます。これにより、オンラインで変更を公開する前に、個人的にサイトで作業することができます。

最終的には、ライブサーバーに移行し、オンライン訪問者がアクセスできるようにする必要があります。この移行は、本番サイトでサイトが正しく機能するようにするために非常に重要です。

私たちは多くのローカルサイトに携わってきたので、コンテンツをライブサイトに移行する最も簡単な方法を学ぶ必要がありました。

この投稿では、WordPressをローカルサーバーからライブサイトに移行する方法をステップバイステップで説明します。

How to move WordPress from local server to live site (2 methods)

なぜWordPressをローカルサーバーからライブサイトに移行するのか?

WordPressブログをローカルサーバーに構築することは、訪問者に影響を与えることなくサイトの変更をテストする安全な方法です。

サイトの完成度が高まったら、次のステップはローカルサーバーからライブサイトに移行することです。

ローカルサーバーからライブサイトにサイトを移動する2つの方法を紹介しよう。

最初の方法はWordPressの移行プラグインを使用するもので、初心者におすすめです。

2つ目の方法では、WordPressをローカルサーバーからライブサイトに手動で移動する方法を紹介します。

自分に合った方法を選べばいい:

WordPressサイトを移行する前に

WordPressをローカルサーバーからライブサーバーに移行するには、いくつかの準備が必要です。

まず、コンピューター上のローカルサーバー(localhostとも呼ばれる)でWordPressサイトが稼動しており、そのサーバーにフルアクセスできると仮定する。

次に、ドメイン名と ホスティングサービスが必要です。

私たちは、貧弱なプロバイダーや無料のホスティングサービスから始めて後悔した初心者から数え切れないほどの話を聞いてきました。私たちの経験では、適切なホスティングサービスを選択することは、任意のサイトの成功に不可欠です。

あなたの決定を容易にするために、私たちはBluehostを使用することをお勧めします。Bluehostは公式推奨のWordPressホスティングサービス会社で、WPBeginnerユーザーに限定割引+ドメインとSSLを無料で提供しています。

基本的に、月額1.99ドルから始めることができる。

あなたは偉大なBluehostの代替をしたい場合は、Hostingerを見ることができます。彼らはまた、無料のドメイン名とWPBeginnerユーザーに排他的な割引を提供しています。

もう少し支払う余裕があるなら、SiteGroundをチェックしよう。WPBeginner読者向けの特別価格もあります。

サイトの立ち上げにお困りの方は、ステップ・バイ・ステップのガイドに従ってください。

最後に、FTPプログラムと、ローカルサーバーのサイトをライブサイトにアップロードするためのFTPの使い方を知っている必要があります。

準備はいいですか?WordPressサイトの移行を始めましょう。

動画チュートリアル

Subscribe to WPBeginner

もし、文章での説明がお望みなら、このまま読み進めてほしい。

方法1:移行プラグインを使ってWordPressをローカルサーバーからライブサイトに転送する(推奨)

この方法は簡単で、初心者におすすめです。WordPress移行プラグインを使用して、WordPressをローカルホストからライブサイトに移行します。

ステップ1:Duplicatorプラグインのインストールとセットアップ

まず、ローカルサイトにDuplicatorプラグインをインストールして有効化する必要があります。詳しくは、WordPressプラグインのインストール方法のステップバイステップガイドをご覧ください。

プロのヒント Duplicatorのプロバージョンもあり、安全なバックアップ、クラウドストレージ、簡単なサイトの復元などが可能です。

有効化した後、Duplicator ” Packagesページで’新規作成’ボタンをクリックしてください。

Create new package for migration

バックアップに名前を付ける画面になります。

そして、「次へ」ボタンをクリックする。

Name backup package

Duplicatorはいくつかのテストを実行し、すべてが正常かどうかを確認します。

すべての項目が「Good」となっていれば、「Build」ボタンをクリックする。

Build package

サイトのサイズによっては、この処理に数分かかる場合があります。完了するまで、このタブを開いたままにしておく必要があります。

完了すると、「インストーラ」と「アーカイブ」パッケージのダウンロードオプションが表示されます。両方のファイルをコンピューターにダウンロードするには、「ワンクリックダウンロード」リンクをクリックする必要があります。

Download package files

アーカイブ」ファイルはWordPressサイトの完全なコピーです。WordPressのコアファイル、画像、アップロード、テーマ、プラグイン、WordPressデータベースのバックアップがすべて含まれています。

インストーラ」ファイルは、サイトを含むアーカイブファイルを解凍することで、移行プロセス全体を自動化するスクリプトです。

ステップ2: WordPressサイトのデータベースを作成する

インストーラを実行したり、WordPressウェブサイトをローカルホストからホスティングサービスサーバーにアップロードしたりする前に、新しいライブウェブサイト用のMySQLデータベースを作成する必要があります。

すでにMySQLデータベースを作成している場合は、このステップは省略できる。

データベースを作成するには、ホスティングサービスのcPanelダッシュボードにアクセスする必要があります。次に、「データベース」セクションを探し、「MySQLデータベースウィザード」アイコンをクリックします。

MySQL Database Wizard

次の画面では、新しいデータベースを作成する欄がある。

データベースの名前を入力し、「データベースを作成」ボタンをクリックします。

Name new database

cPanelはあなたのために新しいデータベースを作成します。

その後、新規ユーザーのユーザー名とパスワードを入力し、「Create User」ボタンをクリックします。

Create new database user

次に、作成したユーザーをデータベースに追加する必要があります。

まず、「すべての権限」のチェックボックスをクリックします。

Check all privileges

その後、下にスクロールして「変更を加える」ボタンをクリックし、変更を保存します。

これでWordPressサイトでデータベースを使用する準備が整いました。データベース名、ユーザー名、パスワードは本当に〜してもよいですか?この情報は次のステップで必要になります。

ステップ3:ローカルサーバーからライブWordPressサイトへのファイルのアップロード

ここで、アーカイブとインストーラファイルをローカルサイトからホスティングサービスアカウントにアップロードする必要があります。

まず、FTPクライアントを使用してライブサイトに接続します。接続したら、サイトのルートディレクトリが完全に空であることを確認してください。

通常、ルート・ディレクトリは/home/public_html/フォルダーです。

WordPressホスティングサービス会社によっては、サインアップすると自動的にWordPressがインストールされます。もしそこにWordPressのファイルがあるなら、削除する必要がある。

その後、Duplicatorから空のルートディレクトリにarchive.zipとinstaller.phpファイルをアップロードします。

Upload archive and installer files

ステップ4:移行スクリプトの実行

移行ファイルのアップロードが完了したら、ブラウザーで以下のURLにアクセスする必要があります:

http://example.com/installer.php

example.com」を自分のドメイン名に置き換えることをお忘れなく。

Duplicator 移行ウィザードが起動します。

インストーラはいくつかのテストを実行し、スクリプトを初期化します。

Duplicator migration wizard step 1

Setup セクションでは、MySQL ホスティングサービス、データベース名、ユーザ名、パスワードを入力するよう求められます。

ホスティングサービスはローカルホストになるでしょう。その後、先のステップで作成したデータベースの詳細を入力します。

その後、’Validate’ボタンをクリックし、入力した内容が正しいことを確認します。

Validate settings

その後、「Next(次へ)」ボタンをクリックして進みます。

Duplicatorはアーカイブから新しいデータベースにWordPressデータベースのバックアップをインポートします。

また、ローカルサイトと新しいライブサイトを指すURLも更新されます。

管理者ログイン」ボタンをクリックして、ライブサイトのWordPress管理エリアに入ることができます。

Admin login

ライブサイトにログインすると、Duplicatorは自動的にインストールファイルをクリーンアップします。

これですべてです。ローカルサーバーからライブサイトへのWordPressの移動は成功です。

方法2:WordPressをローカルサーバーからライブサイトに手動で転送する。

この方法では、WordPressをローカルサーバーからライブサイトに手動で移動する方法を紹介します。最初の方法がうまくいかなかった場合や、手動で行いたい場合に役立ちます。

ステップ1:ローカルのWordPressデータベースをエクスポートする

最初に行う必要があるのは、ローカルのWordPressデータベースをエクスポートすることです。そのためにphpMyAdminを使用します。

phpMyAdminに慣れていない方は、phpMyAdminを使ったWordPressデータベース管理のガイドをご覧ください。

http://localhost/phpmyadmin/、WordPressデータベースをクリックします。次に、上のメニューバーから「エクスポート」ボタンをクリックします。

Export from localhost

Export method:’オプションで、’Quick’または’Custom’を選択できます。カスタマイザーでは、データベースをエクスポートするためのオプションが増えます。

しかし、「クイック」を選択し、「Go」ボタンをクリックしてデータベースをダウンロードすることをお勧めします。

Export WordPress database using phpMyAdmin

ステップ2:WordPressファイルをライブサイトにアップロードする

次に、すべてのウェブサイトファイルをライブサイトに移動する必要があります。

まず、FTPクライアントを開き、ホスティングサービスアカウントに接続します。

ライブサイトに接続したら、正しいディレクトリにファイルをアップロードしていることを確認してください。例えば、サイトを’yoursite.com’にホスティングサービスしたい場合、public_htmlディレクトリにすべてのファイルをアップロードします。

ローカルのWordPressファイルを選択し、ライブサーバーにアップロードします。

Upload WordPress files FTP

ステップ3: ライブサイトにMySQLデータベースを作成する

FTPクライアントがWordPressファイルをアップロードしている間に、データベースのライブサーバーへのインポートを開始できます。

ほとんどのWordPressホスティングサービスプロバイダは、あなたのホスティングアカウントを管理するためにcPanelを提供していますので、我々はcPanelを使用してデータベースを作成する方法を紹介します。

まず、cPanelダッシュボードにログインし、「データベース」セクションにある「MySQLデータベースウィザード」アイコンをクリックします。

Select MySQL database wizard

次の画面では、新しいデータベースを作成することができます。

データベースの名前を入力し、「データベースを作成」をクリックします。

Name and create new database

cPanelは自動的に新しいデータベースを作成します。

次に、新規ユーザーのユーザー名とパスワードを入力し、「ユーザーを作成」をクリックします。

Create new database user

その後、作成したユーザーをデータベースに追加する必要がある。

まず、’All Privileges’ チェックボックスをチェックする。

Check all privileges checkbox

その後、下にスクロールして「変更を加える」をクリックし、変更を保存します。

WordPressサイトの新規データベースの作成が完了しました。

ステップ4:WordPressデータベースをライブサイトにインポートする

次のステップでは、WordPressデータベースをインポートします。

cPanelのダッシュボードに行き、「データベース」セクションまでスクロールダウンし、「phpMyAdmin」をクリックします。

Click on phpMyAdmin

phpMyAdminに移動し、先ほど作成したデータベースをクリックします。phpMyAdminには、テーブルのない新しいデータベースが表示されます。

次に、上部メニューの「インポート」タブをクリックします。インポートページで「ファイルを選択」ボタンをクリックし、最初のステップで保存したローカルサイトのデータベースファイルを選択します。

Import database via phpMyAdmin

その後、ページ下部の「Go」ボタンをクリックします。データベースが自動的にphpMyadminにインポートされます。

ステップ5:サイトURLの変更

次に、データベースのサイトURLを変更して、ライブWordPressサイトに接続できるようにする必要がある。

phpMyAdminで、先ほどインポートしたデータベースのwp_optionsテーブルを探します。

データベースのプレフィックスを変更した場合、wp_optionsの代わりに{new_prefix}_optionsになるかもしれません。

次に、wp_optionsの隣にある「Browse」ボタンをクリックします。または、サイドバーのリンクをクリックして、wp_optionsテーブル内のフィールドのリストがあるページを開きます。

Browse the wp options table

次にoptions_nameカラムでsiteurlオプションを探す必要があります。

次に「編集」アイコンをクリックする。

Edit siteurl in phpMyAdmin

フィールドを編集するウィンドウが表示されます。

入力ボックスoption_valueには、ローカルインストールのURLが表示されます。http://localhost/test のようなものです。

このフィールドに新規サイトのURLを挿入する必要があります。例:https://www.wpbeginner.com.

その後、「Go」ボタンをクリックしてフィールドを保存することができます。

edit the siteurl field

次に、上記と同じ手順でホーム・オプション名を設定します。wp_optionsメニューは数ページにわたることがあります。通常、ホームオプションは2ページ目に設定されます。

次に、ホームURLを更新し、ライブサイトのURLと同じにする。

ステップ6: ライブサイトのセットアップ

データベースのインポートとコンテンツのアップロードが完了したら、次はWordPressの設定です。

このとき、サイトには「Error establishing a database connection(データベース接続の確立エラー)」というエラーが表示されているはずです。

これを修正するには、FTPクライアントを使用してサイトに接続し、wp-config.phpファイルを開きます。

以下のコード行を探すことになる:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );
/** MySQL database username */
define( 'DB_USER', 'username_here' );
/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

先に作成したデータベース名、ユーザー名、パスワードをプロバイダーとして入力する必要があります。

次に、wp-config.phpファイルを保存し、WordPressホスティングサービスサーバーにアップロードします。

さて、あなたのサイトにアクセスすると、それはライブであるべきだ。

その後、WordPress管理画面にログインし、設定 ” 一般に移動する必要があります。その後、何も変更せずに一番下までスクロールし、「変更を保存」ボタンをクリックします。

Save general settings

これにより、サイトのURLが必要な場所に修正されるようになります。

それができたら、設定 ” パーマリンクに行き、スクロールダウンして「変更を保存」をクリックし、すべての投稿リンクが問題なく機能していることを確認してください。

Save permalinks settings

WordPressサイトをあるドメインから別のドメインへ、またはローカルサーバーからライブサイトへ移動する際には、必ずリンク切れや画像の欠落に直面します。

URLを更新する2つの方法をご紹介します。あなたに最適な方法を選んでください。

1.Search & Replace Everythingプラグインを使ってURLを更新する(推奨)

これを解決する最も安全な方法は、Search & Replace Everythingを使用することです。これは強力なWordPressプラグインで、複雑なデータベースクエリーを書くことなく、簡単にサイトの一括更新作業を行うことができます。

まず、Search & Replace Everythingプラグインをインストールして有効化する必要があります。

有効化した後、Tools ” WP Search & Replaceページにアクセスしてください。

Search and replace URLs from local to live site migration

ここから、’Search for’フィールドにローカルサイトのURLを、’Replace with’フィールドにライブサイトのURLを入力する必要があります。

少しスクロールして、テーブルの下の「すべて選択」をクリックします。これにより、プラグインがデータベース内のあらゆる場所で古いURLを探すようになります。

Select tables

ここで「検索と置換のプレビュー」ボタンをクリックして続行する。

プラグインは、古いURLのすべてのインスタンスをデータベースから検索し、結果をプレビューします。

Preview changes

問題がなければ、「すべて置換」をクリックして変更を保存する。

変更についての警告が表示されます。続行するには「はい」をクリックしてください。

プラグインはデータベースを更新し、ローカルのURLを現在のサイトのURLに置き換えます。

2.手動でURLを更新する(上級者向け)

URLを更新するもう一つの方法は、以下のSQLクエリーを使うことである:

UPDATE wp_posts SET post_content = REPLACE(post_content, 'localhost/test/', 'www.yourlivesite.com/');

phpMyAdminにアクセスしてデータベースをクリックし、上部メニューから「SQL」をクリックして上記のクエリーを追加するだけです。

ローカルサイトとライブサイトのURLに変更し、「Go」ボタンをクリックすることを本当に〜してもよいですか?

Fixing WordPress images and broken URLs after moving to live site

これで完了です。これでローカルサーバーからライブサイトへのWordPressの移行は成功です。

うまくいけば、あなたのライブサイトはスムーズに稼働しています。エラーにお気づきの場合は、WordPressの一般的なエラーガイドをご覧いただき、トラブルシューティングにお役立てください。

この投稿が、WordPress をローカルサーバーからライブサイトに移行する際にお役に立てば幸いです。また、ライブサイトからローカルサーバーへの移行に関するガイド、または WordPress 移行の実践的な手順に関する究極のウェブサイト移行チェックリストもご覧ください。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

アバター

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

909件のコメント返信を残す

  1. Syed Balkhi

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Lisa

    On step 4, when I try to import the gzipped database I get this:
    Error
    SQL query:


    — Database: `testbtat`

    CREATE DATABASE IF NOT EXISTS `testbtat` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
    MySQL said: Documentation

    #1044 – Access denied for user ‘btatxcom’@’localhost’ to database ‘testbtat’

    • Bunty Gurung

      @Lisa the import could be a .zip or plain text .sql file, does not matter. You are getting the error because name of the database you are trying to upload does not match with the name that you have created.

      In this case I assume that your username on the live site is ‘btatxcom’. So generally your database would be btatxcom_yourdb. If that is the case, go to localhost. Simply export your database as a .sql file – without using custom options. Save it on desktop. Rightclick open-with notepad++ (if you do not have it on pc, just download, it is very easy in usage eg. like notepad, just a bit more fancy).

      You will find this line CREATE DATABASE IF NOT EXISTS around line number 22 or else search for the term. Now there, the name of your database occurs twice, change it to match the name of database on your live site eg. someprefix_yourdb. Save it, go to your phpmyadmin -> your database -> browse and import the saved .sql file. That should do it. Hope this helps someone.

  3. Wanda Serros

    Thank you for the tutorial. I followed all the steps correctly I believe. It worked like a charm until I went to look at my site. I get the following:

    Your server is running PHP version 4.4.9 but WordPress 3.8.1 requires at least 5.2.4.

    although when I go to my Cpanel it says: PHP version 5.3.26

    Also when I try to go to admin I get:

    Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/drser3/public_html/wp-admin/index.php on line 103

    I appreciate any help you can give me. Thanks

    Wanda

    • WPBeginner Support

      Please contact your web hosting service provider. They will be able to assist you better in this matter.

      管理者

    • Wanda Serros

      My website is now up and running although I have some issues to correct. Just thought I’d report back for other user who might be using Lunarpages for webhosting. I had to go to control panel and choose PHP5, then a phpini file had to be added under my public_html directory with

      memory=64MB

      and lastly I had to add:

      suPHP_ConfigPath /home/username/public_html

      into my htaccess file.

  4. Wisdom

    thank you. was so helpful

  5. David

    Hi,

    I can access the wp-admin after moving the database over but for some reason I get a whitescreen when I type my url in. It doesn’t seem to be finding the html / css for any of the pages. Its odd because It loads perfectly on the wamp localhost.

    Any ideas?

    thanks

    • WPBeginner Support

      Go to Settings -> General and make sure your WordPress Site and Home urls point to your new location.

      管理者

  6. Roanna

    You do not know how much this article has helped me!
    Thank you so much for taking the time to write and post this!

  7. Sam

    Thanks for your tutorial, its very helpful.

  8. Janeth

    Great tutorial, thank you very much.

    I guess it is the same process from a dev server to production server right?

  9. AM

    Thank you so much for posting these instructions!! I could NOT have transferred my client’s site to the live site without this!! Just one note: Under Step 3, your instructions are missing the note about “hostname”. This took me a sec to figure out but I was able to add that in. In case anyone else has any problems with that part of the database creation. Thanks again!!

  10. abel kayode

    Hi
    Thanks for the educative article.
    I followed every step but I end up getting this error

    Parse error: syntax error, unexpected ‘DB_PASSWORD’ (T_STRING) in /home/swagphot/public_html/wp-config.php on line 26

    I checked my wp-config for typo but everything seems correct I need help, I don’t know how to
    Resolve this… Thanks

  11. Miriam

    I am brand new to this and this explanation is by far the clearest explanation I have found but I am still having problems. I have transferred my files to my host server but am stuck on the database. I have a local installation of WordPress established with Bitnami. When I go to http://localhost/phpmyadmin/, I don’t see my database; I only see information_schema and test. I checked my wp-config.php and see ‘DB_NAME’, ‘bitnami_wordpress’. I am clueless as what to do or where to look next. Any help would be greatly appreciated. Thanks.

    • WPBeginner Support

      In your wp-config.php check your DB_User and DB_Password use these to log into phpMyAdmin and then you will be able to see your database bitnami_wordpress

      管理者

      • Miriam

        THANK YOU. THANK YOU. THANK YOU!!!!!

  12. Sisira

    Awsome Tutorial………………..Very useful for a beginner……….I just tried and made my site live……………………..This is my first website……………Thank you so much………………. :)

  13. james Daly

    Thank you so much for this article – It was easy to follow and worked out perfectly for me – thought it would be a daunting process but was pretty easy if you followed the steps correctly

  14. Bilal Ahmad

    i done all theme steps.. after this i cannot acces to my dashboad. when ever i go to my admin pannel and enter the username and pass which is correct. But it cannot redirect me to my dashboad. its redirect me to my admin panel again and again. pls help

  15. Kirit Patel

    This tutorial is very important for beginner, who doesn’t know how to move local wp site to live site. it is useful for me.
    Thanks a lots.

  16. mira

    hi,
    thanks for this useful article.
    bt i have an error like
    1044 access denied
    pls would u help me out from this database error?

    • jay

      To solve the 1044 Access denied error. You should open the database file in your text editor and delete the following code.

      — Database: `XYZ`

      CREATE DATABASE IF NOT EXISTS `XYZ` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
      USE `XYZ`;

  17. Terry

    Thanks for all your help with these tutorials! I am learning a lot. I have a problem that has been mentioned before but I am not getting a solution.
    I’m stuck on step 6, I keep getting Error establishing a database connection.
    I did change one thing in your procedure, in step 6 I edited wp-config.php to include define(‘DB_HOST’, ‘www.mysite.com/my_staging_site’);
    Anyway, I still can’t connect, and if there is anything you can do to point me in the right direction I would appreciate it!

    • charles

      I had this problem as well but make sure there are no small typos when entering in the database name, username, password, and host. My problem was the aposhtrophe symbol were different (‘ symbol). When I started changing the name the apostrophe changed to a different symbol and it is really hard to tell if it changed. But i fixed this and it worked

    • rahul

      U just needed to change the dbname and site cpanel username and password to the feild it is asked in wp-config.php

  18. Jody Hockley

    Thanks for such an easy to follow and simple guide. Did it all in under 20mins. Has made my life so much easier. Much appreciated…

  19. Vivek

    Followed the same steps.

    Website got live on server but facing the following problem.

    Menus are not appearing in Admin Panel.

    The settings are not saving if try to make any changes.

    Any idea?

  20. WawanAdie

    Okay. it will be useful thanks

  21. jeret

    Hi, i have successfully upload all the files to the web server. I am able to view my wordpress site.
    The problem is when i try to access the admin page. Using the username and password which i created using the cpanel, is not working. it says invalid username. I have modified the wp-config.php file. I have made sure the new username and password are updated.

    What about this line in config file what do i change it to :
    /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);

    Thanks.

    • Mustafa

      Check for:

      /** MySQL hostname */
      define(‘DB_HOST’, ‘mysql.yoursite.com’);

  22. Miroslava Donchev

    Thank you for the wonderful article! I am so grateful there’re people like you to share knowledge :)

    I transferred my local site to live hosted site and I got only one error so I want to share how I solved it. I got a black page on the the permalink options page and I found the following solution from DebbieV:

    “I edited wp-admin/includes/misc.php, forcing the value of $got_rewrite = true;”

    May be that can help somebody else as well.

    Cheers!
    Mira

  23. dhani

    Hi,

    Is there any way to export from wordpress.org to wordpress.com without having to host the site and pay?

    I have my blog in wp.org but want it to go live without paying…just wondering if there are any options for this.

    Thank you.

  24. Jay

    I followed all of the instructions except for exporting my database from localhost in gzipped because I tried importing on live server in phpMyadmin it gave me an error “#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘?’ at line 1”. But it import the database when I use zipped compression but after waiting 7 hours to upload all my files from localhost to live server it asked me to install WordPress and when I install WordPress none of my posts are in there.

    • Jay

      I have already changed the information for the database in wp-config and still it asks me to install WordPress

      • WPBeginner Support

        Did you change database table prefix? Are you sure that the database you are connected to is not empty?

        管理者

      • Jigar

        I had same problem but solve with database prefix, It must be same as in database on server,

        Thanks ADMIN,

  25. soon hao ng

    Thanks for your tutorials provided. It’s very helpful. I managed to move my wordpress from local server to live site. However, when I login to my admin panel. The error message was shown:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

    Could any experts here please advise how to fix this problem?

    Thanks

  26. tatiana

    Hello,.I intend to upload a localhost to a server … I’ve done all the above steps MANY TIMES .. but this message always appears” You don’t have permission to access / on this server..

  27. Jose

    Hi. Thanks this post is more useful than all the other stuff i found on youtube.
    However, I can´t seem to get my site up and running, even after following all the steps carefully.
    I can access my admin from my live website, and everything including plugins and themes, posts and pages seems to be up there on the dashboard. However the website, even accessing it from the dashboard itself shows a blank page. Any clue where the problem might be and what I might do to solve it?
    Thanks!

      • Jose

        Thank you!

        It turned out I was using a child theme. Switching to the original theme and making changes from the theme’s settings instead of the new stylesheet solved the white screen of death. Thank you for the clear, thorough and useful blog.

        Jose

        • David

          Your issue was exactly the same as my issue now. Only, I am not using a child theme, its a custom theme. Just can’t get it to work even though it works on my localhost.

          Can anyone advise me on this?

          Thanks

  28. Mai

    Hi, I think I may have commented too soon. Everything works fine except for the recent comments section where it doesn’t display comments, but links to “localhost” blog entries.
    This is my blog: http://www.sugaroverkill.com/blog/
    I’ve done all the steps including #7. Is there another step I need to do for the recent comments to display correctly?

  29. Mai

    Thanks for the article. It worked like a charm! ;)

  30. Jack Allen

    Hi, Was just wondering if you had to change the DB Hostname in the wp-config file as ive still got error establishing database connection. Thanks Jack

  31. Beth

    Thank you for this resource! Everything appears to be working properly with the migrated site, but we are unable to access the new site’s wp-admin to log into WordPress. We did not do a new install of wordpress, we simply transferred all files of the previous site to the new directory. Is a wordpress install necessary if a site is up an running on two different URLS?

    • WPBeginner Support

      You would also need to move your database. No when moving WordPress from one location to another you don’t really need to run the install script again.

      管理者

  32. Verna

    Just wanted to drop you a line to say THANK YOU !!!
    Your instructions worked perfectly for a first time user and your efforts are really, really appreciated.
    Bless You !

  33. annie

    hello there,
    I’m planning to use this tutorial to transfer localhost for the first time.. (I haven’t read it all yet)

    but, I’ve noticed I need to use phpadmin and since I’ve first used WAMP I wasn’t able to use phpadmin and I’m not quite sure what’s wrong (I’m sorry if you mention this somewhere here please ignore my comment),…

    Is there any way I can transfer my site without phpadmin? i.e. by copying and pasting something?

    excuse me as I am completely new to this…

    thank you

      • annie

        thank you for your reply

      • annie

        hello again,
        I have followed every step successfully but i can’t go to step 6 because the ftp upload to public_html has stuck at 99%

        any idea what might be wrong?

        thanks.

  34. Hitesh

    hey i did the same you mention here but still i cant change theme logo i import old site to new site

  35. Jeff Matt

    Thank you so much! This worked perfectly for me and I no longer worry about developing in MAMP any more. Cheers!

  36. Rajeev

    Many Thanks for this tutorial :)

  37. Jose Luis

    Thanks for all! You save my life! ;)

    • ashish gupta

      I really understand what you are actually saying, first time i also hung up on that situation and i did not know how to do that.

  38. Westy

    Hi, thank you for a great tutorial.
    Everything seems to run smoothly for me except the appearance is completely messed up.
    I am using bp default theme with a child theme on the local server. After the import the bp default (parent) does not show in the Appearance>Themes setting which breaks my child theme. However all the folders etc for bp-default have been uploaded from local to live site, so I can not work out why the issue is occurring.
    Has anyone else had this problem and can help me fix it?
    Thank you for your time.

    • clare

      Weary, just wondering if you solved your problem. And if so how?

      I’m currently having the opposite problem. My child theme worked great on the local server, but in migrating it to the live server, it’s now broken and it restored the parent theme . I’m hoping if you fixed your problem it would clue me in to what I am doing wrong.

  39. Pomen Yala

    Thanks for sharing this info. Life lot’s easier to switch wordpress for me now :)

  40. Heidi Anderson

    Hello, I really need some help. I get to step4 and I find my new db that I created in the SQL server, it has no tables, I click on it, I hit import and I get the following in red, “The directory you set for upload work cannot be reached”. This is before I even try to upload my file. What did I do wrong?

  41. Venkat

    Hai.. Your tutorial teach very clear. I am so happy about your help. Thanks !

    • Priyanka

      hey thanks for sharing such awesome tutorial….:)

  42. Samantha

    Hi, I exported my database from localhost and im trying to do step 4. I got the error 1044 but seen on previous comments to delete a section and change to my live database name. I tried to import again and now I get the error

    #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘– phpMyAdmin SQL Dump
    — version 4.0.4
    http://www.phpmyadmin.net

    — Ho’ at line 1

    Can you help at all??

  43. Quentin

    Excellent guide – very clear. And, I learned a few useful things in the process. Thank you.

  44. Gwen

    When I try to import my sql file into the new database, I get this error from phpMyAdmin:

    #1103 – Incorrect table name

    Any ideas on what I might be doing wrong?

    • WPBeginner Support

      When creating your export file make sure that your export file has Create Tables if not exist checked.

      管理者

  45. Gwen

    Hi there! I get this error from phpMyAdmin when I try to import my sql file into the new database on the live server:

    #1103 – Incorrect table name

    Any ideas on what I might be doing wrong?

  46. Parisa

    Hi,

    Thank you for the article. I went through the steps but when I go to the website I see “Index of/” and below that I see the files and folders uploaded on the website. When I click on the files I get “Error establishing a database connection” . Could you help me with it?

    tnx

    • Jennifer

      I am also having that same issue. Have you found any solutions?

      • Jennifer

        Actually, I don’t get the “Index of/” message or folder, just the “Error establishing a database connection” message.

        I’m using GoDaddy for my hosting account and they had a slightly different process for setting up users for the database (it’s an all-in-one step, where your database name is also your username). I’m wondering if that’s what’s causing the disconnect.

        I’m also putting my WordPress install in a subfolder, rather than the root directory. So I added that folder after my URL when I made my table edits. Could that be an issue?

      • AWASAE

        i think you guys have your website files not immediately inside public_html directory! i think you have the in a folder inside public_html

        go inside the folder select all files and move them a step in the root directory

        WRONG: public_html/AFolderContainingAllFiles/{allfiles}
        RIGHT: public_html/{allfiles}

  47. Shawn

    Correction to your mysql query:

    UPDATE wp_posts SET post_content = REPLACE(post_content, ‘localhost/test/’, ‘www.yourlivesite.com’);

    should be..

    UPDATE wp_posts SET post_content = REPLACE(post_content, ‘localhost/test/’, ‘www.yourlivesite.com/’);

    (The forward slash was missing)

  48. Anna

    Hi,

    I created a new WP site for an existing URL where the old site is currently active. I need to test the shopping cart/payment gateway of the new WP site using an SSL, which resides on the existing site. So I created a sub-folder and migrated the new WP site to this folder from MAMP. I can access the login page, but after logging in, I get a 404 “wp-login.php was not found on the server.” I checked via ftp access and it’s there in the folder. Seems I need to update something else. Or, can I copy the SSL folder to my MAMP so testing can happen locally? Thanks for any suggestions.

    Anna

  49. swati

    After doing same steps as per your article i am able to live only home page but with no images and slider..along with this my other pages are not live on localhost…it gives same error for all inside pages that not found on this server..plz help me…

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。