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

Wie man WordPress von einem lokalen Server auf eine Live-Site verschiebt (2 Methoden)

Hinweis der Redaktion: Wir erhalten eine Provision für Partnerlinks auf WPBeginner. Die Provisionen haben keinen Einfluss auf die Meinung oder Bewertung unserer Redakteure. Erfahre mehr über Redaktioneller Prozess.

Viele WordPress-Nutzer ziehen es vor, ihre Websites auf einem lokalen Server auf ihrem Computer zu bearbeiten, bevor sie sie auf einen Live-Hosting-Server übertragen.

Es ermöglicht Ihnen, Ihre Website privat zu bearbeiten, bevor Sie die Änderungen online zugänglich machen.

Schließlich müssen Sie sie auf einen Live-Server verschieben, um sie für Online-Besucher verfügbar zu machen.

In diesem Artikel zeigen wir Ihnen eine Schritt-für-Schritt-Anleitung, wie Sie WordPress von einem lokalen Server auf eine Live-Site umziehen.

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

Warum WordPress von einem lokalen Server auf eine Live-Site verschieben?

Die Erstellung Ihres WordPress-Blogs auf einem lokalen Server ist ein sicherer Weg, um Änderungen an Ihrer Website zu testen, ohne die Besucher zu beeinträchtigen.

Wenn Sie Ihre Website perfektioniert haben, ist der nächste Schritt der Umzug von Ihrem lokalen Server auf eine Live-Site.

Wir zeigen Ihnen zwei Möglichkeiten, wie Sie Ihre Website von einem lokalen Server auf eine Live-Site übertragen können.

Die erste Methode verwendet ein WordPress-Migrations-Plugin und ist für Anfänger zu empfehlen.

In der zweiten Methode zeigen wir Ihnen, wie Sie WordPress manuell von einem lokalen Server auf eine Live-Site verschieben können.

Sie können die Methode wählen, die für Sie am besten geeignet ist:

Bevor Sie Ihre WordPress-Website migrieren

Um WordPress von einem lokalen Server auf einen Live-Server zu migrieren, müssen Sie ein paar Dinge vorbereiten.

Zunächst gehen wir davon aus, dass Sie eine WordPress-Website auf einem lokalen Server (auch localhost genannt) auf Ihrem Computer laufen haben und Sie vollen Zugriff darauf haben.

Als Nächstes benötigen Sie einen Domänennamen und Webhosting.

Um Ihnen die Entscheidung zu erleichtern, empfehlen wir Bluehost. Bluehost ist ein offiziell empfohlener WordPress-Hosting-Anbieter und bietet WPBeginner-Nutzern einen exklusiven Rabatt sowie eine kostenlose Domain und SSL.

Im Grunde können Sie schon für 1,99 $ pro Monat einsteigen.

Wenn Sie eine gute Bluehost-Alternative suchen, können Sie sich Hostinger ansehen. Sie bieten auch einen exklusiven Rabatt für WPBeginner-Nutzer mit einem kostenlosen Domainnamen.

Wenn Sie es sich leisten können, ein wenig mehr zu bezahlen, dann schauen Sie sich SiteGround an. Sie haben auch ein spezielles Angebot für WPBeginner-Leser.

Wenn Sie Hilfe bei der Einrichtung Ihrer Website benötigen, folgen Sie unserer Schritt-für-Schritt-Anleitung für die Erstellung einer Website.

Schließlich benötigen Sie ein FTP-Programm und müssen wissen , wie Sie FTP verwenden, um Ihre lokale Server-Site auf die Live-Site hochzuladen.

Sind Sie bereit? Beginnen wir mit der Migration Ihrer WordPress-Website.

Video-Anleitung

Subscribe to WPBeginner

Wenn Sie eine schriftliche Anleitung bevorzugen, dann lesen Sie einfach weiter.

Methode 1: Übertragen von WordPress vom lokalen Server auf die Live-Site mithilfe eines Migrations-Plugins (empfohlen)

Diese Methode ist einfacher und wird für Anfänger empfohlen. Wir werden ein WordPress-Migrations-Plugin verwenden, um WordPress vom lokalen Host auf eine Live-Site zu verschieben.

Schritt 1: Installieren und Einrichten des Duplicator-Plugins

Zunächst müssen Sie das Duplicator-Plugin auf Ihrer lokalen Website installieren und aktivieren. Weitere Einzelheiten finden Sie in unserer Schritt-für-Schritt-Anleitung für die Installation eines WordPress-Plugins.

Profi-Tipp: Es gibt auch eine Pro-Version von Duplicator, die sichere Backups, Cloud-Speicher, einfache Wiederherstellung von Websites und mehr bietet.

Nach der Aktivierung müssen Sie auf die Seite Duplicator “ Pakete gehen und auf die Schaltfläche „Neu erstellen“ klicken.

Create new package for migration

Daraufhin wird ein Bildschirm angezeigt, in dem Sie der Sicherung einen Namen geben können.

Klicken Sie dann auf die Schaltfläche „Weiter“.

Name backup package

Duplicator führt nun einige Tests durch, um festzustellen, ob alles in Ordnung ist.

Wenn alle Punkte mit „Gut“ markiert sind, klicken Sie auf die Schaltfläche „Erstellen“.

Build package

Dieser Vorgang kann einige Minuten dauern, je nach Größe Ihrer Website. Sie müssen diese Registerkarte geöffnet lassen, bis der Vorgang abgeschlossen ist.

Sobald Sie fertig sind, sehen Sie Download-Optionen für „Installer“- und „Archiv“-Pakete. Klicken Sie auf den Link „One-Click Download“, um beide Dateien auf Ihren Computer herunterzuladen.

Download package files

Die „Archiv“-Datei ist eine vollständige Kopie Ihrer WordPress-Website. Sie enthält alle WordPress-Kerndateien sowie Ihre Bilder, Uploads, Themes, Plugins und ein Backup Ihrer WordPress-Datenbank.

Die „Installer“-Datei ist ein Skript, das den gesamten Migrationsprozess automatisiert, indem es die Archivdatei mit Ihrer Website entpackt.

Schritt 2: Erstellen Sie eine Datenbank für Ihre Live-WordPress-Website

Bevor Sie das Installationsprogramm ausführen oder die WordPress-Website von localhost auf Ihren Hosting-Server hochladen können, müssen Sie eine MySQL-Datenbank für Ihre neue Live-Website erstellen.

Wenn Sie bereits eine MySQL-Datenbank erstellt haben, können Sie diesen Schritt überspringen.

Um eine Datenbank zu erstellen, müssen Sie das cPanel-Dashboard Ihres Hosting-Accounts aufrufen. Suchen Sie dann den Abschnitt „Datenbanken“ und klicken Sie auf das Symbol „MySQL-Datenbank-Assistent“.

MySQL Database Wizard

Auf dem nächsten Bildschirm gibt es ein Feld zum Erstellen einer neuen Datenbank.

Geben Sie einfach einen Namen für Ihre Datenbank ein und klicken Sie auf die Schaltfläche „Datenbank erstellen“.

Name new database

cPanel wird nun eine neue Datenbank für Sie erstellen.

Danach müssen Sie einen Benutzernamen und ein Passwort für Ihren neuen Benutzer eingeben und dann auf die Schaltfläche „Benutzer erstellen“ klicken.

Create new database user

Als nächstes müssen Sie den soeben erstellten Benutzer zur Datenbank hinzufügen.

Klicken Sie zunächst auf das Kontrollkästchen „Alle Berechtigungen“.

Check all privileges

Blättern Sie dann nach unten und klicken Sie auf die Schaltfläche „Änderungen vornehmen“, um Ihre Änderungen zu speichern.

Ihre Datenbank ist nun bereit, mit Ihrer WordPress-Website verwendet zu werden. Notieren Sie sich unbedingt den Namen der Datenbank, den Benutzernamen und das Passwort. Sie werden diese Informationen im nächsten Schritt benötigen.

Schritt 3: Dateien vom lokalen Server auf die Live-WordPress-Website hochladen

Nun müssen Sie das Archiv und die Installationsdateien von Ihrer lokalen Website auf Ihr Hosting-Konto hochladen.

Stellen Sie zunächst mit einem FTP-Client eine Verbindung zu Ihrer Live-Website her. Vergewissern Sie sich nach der Verbindung, dass das Stammverzeichnis Ihrer Website völlig leer ist.

Normalerweise ist das Stammverzeichnis der Ordner /home/public_html/.

Einige WordPress-Hosting-Unternehmen installieren WordPress automatisch, wenn Sie sich anmelden. Wenn Sie dort WordPress-Dateien haben, müssen Sie diese löschen.

Danach können Sie die Dateien archive.zip und installer.php von Duplicator in Ihr leeres Stammverzeichnis hochladen.

Upload archive and installer files

Schritt 4: Ausführen des Migrationsskripts

Nachdem Sie die Migrationsdateien hochgeladen haben, müssen Sie die folgende URL in Ihrem Browser aufrufen:

http://example.com/installer.php

Vergessen Sie nicht, „example.com“ durch Ihren eigenen Domänennamen zu ersetzen.

Dadurch wird der Duplicator-Migrationsassistent gestartet.

Das Installationsprogramm führt ein paar Tests durch und initialisiert das Skript.

Duplicator migration wizard step 1

Im Abschnitt Setup werden Sie aufgefordert, den MySQL-Host, den Datenbanknamen, den Benutzernamen und das Passwort einzugeben.

Ihr Host wird wahrscheinlich localhost sein. Danach geben Sie die Details der Datenbank ein, die Sie im vorherigen Schritt erstellt haben.

Klicken Sie dann auf die Schaltfläche „Validieren“, um sicherzustellen, dass die eingegebenen Daten korrekt sind.

Validate settings

Klicken Sie anschließend auf die Schaltfläche „Weiter“, um fortzufahren.

Duplicator importiert nun die Sicherung Ihrer WordPress-Datenbank aus dem Archiv in Ihre neue Datenbank.

Außerdem werden die URLs, die auf die lokale Website verweisen, auf Ihre neue Live-Site aktualisiert.

Sie können nun auf die Schaltfläche „Admin Login“ klicken, um in den WordPress-Administrationsbereich Ihrer Live-Site zu gelangen.

Admin login

Sobald Sie sich bei Ihrer Live-Site anmelden, bereinigt Duplicator automatisch die Installationsdateien.

Das war’s schon. Sie haben WordPress erfolgreich vom lokalen Server auf Ihre Live-Site verschoben.

Methode 2: Manuelle Übertragung von WordPress vom lokalen Server auf die Live-Site

In dieser Methode zeigen wir Ihnen, wie Sie WordPress manuell vom lokalen Server auf Ihre Live-Site verschieben können. Sie ist nützlich, wenn die erste Methode nicht funktioniert oder wenn Sie es lieber manuell machen möchten.

Schritt 1: Lokale WordPress-Datenbank exportieren

Als Erstes müssen Sie Ihre lokale WordPress-Datenbank exportieren. Wir werden dafür phpMyAdmin verwenden.

Wenn Sie damit nicht vertraut sind, sollten Sie einen Blick auf unsere Anleitung zur WordPress-Datenbankverwaltung mit phpMyAdmin werfen.

Gehen Sie einfach auf http://localhost/phpmyadmin/ und klicken Sie auf Ihre WordPress-Datenbank. Klicken Sie dann auf die Schaltfläche „Exportieren“ in der oberen Menüleiste.

Export from localhost

Bei der Option „Exportmethode:“ können Sie „Schnell“ oder „Benutzerdefiniert“ wählen. Die Option „Benutzerdefiniert“ bietet Ihnen mehr Optionen für den Export Ihrer Datenbank.

Wir empfehlen jedoch, „Schnell“ zu wählen und dann auf die Schaltfläche „Los“ zu klicken, um Ihre Datenbank herunterzuladen.

Export WordPress database using phpMyAdmin

Schritt 2: WordPress-Dateien auf die Live-Site hochladen

Nun müssen wir alle Dateien Ihrer Website auf die Live-Site verschieben.

Um loszulegen, öffnen Sie Ihren FTP-Client und verbinden Sie sich mit Ihrem Webhosting-Konto.

Sobald Sie mit Ihrer Live-Site verbunden sind, müssen Sie sicherstellen, dass Sie die Dateien in das richtige Verzeichnis hochladen. Wenn Sie zum Beispiel möchten, dass die Website auf „yourite.com“ gehostet wird, müssen Sie alle Dateien in Ihr Verzeichnis public_html hochladen.

Wählen Sie nun Ihre lokalen WordPress-Dateien aus und laden Sie sie auf Ihren Live-Server hoch.

Upload WordPress files FTP

Schritt 3: Erstellen Sie eine MySQL-Datenbank auf Ihrer Live-Site

Während Ihr FTP-Client Ihre WordPress-Dateien hochlädt, können Sie damit beginnen, Ihre Datenbank auf den Live-Server zu importieren.

Die meisten WordPress-Hosting-Provider bieten cPanel zur Verwaltung Ihres Hosting-Kontos an. Wir zeigen Ihnen, wie Sie mit cPanel eine Datenbank erstellen können.

Melden Sie sich zunächst in Ihrem cPanel-Dashboard an und klicken Sie auf das Symbol „MySQL-Datenbank-Assistent“, das Sie im Abschnitt „Datenbanken“ finden.

Select MySQL database wizard

Auf dem nächsten Bildschirm können Sie eine neue Datenbank anlegen.

Geben Sie einen Namen für Ihre Datenbank ein und klicken Sie dann auf „Datenbank erstellen“.

Name and create new database

cPanel wird nun automatisch eine neue Datenbank für Sie erstellen.

Als Nächstes müssen Sie einen Benutzernamen und ein Passwort für Ihren neuen Benutzer eingeben und dann auf „Benutzer erstellen“ klicken.

Create new database user

Danach müssen Sie den soeben erstellten Benutzer in die Datenbank aufnehmen.

Aktivieren Sie zunächst das Kontrollkästchen „Alle Berechtigungen“.

Check all privileges checkbox

Blättern Sie dann nach unten und klicken Sie auf „Änderungen vornehmen“, um Ihre Änderungen zu speichern.

Sie haben erfolgreich eine neue Datenbank für Ihre Live-WordPress-Site erstellt.

Schritt 4: WordPress-Datenbank in die Live-Site importieren

Der nächste Schritt ist der Import Ihrer WordPress-Datenbank.

Gehen Sie zu Ihrem cPanel-Dashboard, scrollen Sie nach unten zum Abschnitt „Datenbanken“ und klicken Sie auf „phpMyAdmin“.

Click on phpMyAdmin

Dies führt Sie zu phpMyAdmin, wo Sie auf die Datenbank klicken, die Sie gerade erstellt haben. phpMyAdmin zeigt Ihre neue Datenbank ohne Tabellen an.

Klicken Sie dann im oberen Menü auf die Registerkarte „Importieren“. Klicken Sie auf der Importseite auf die Schaltfläche „Datei auswählen“ und wählen Sie dann die Datenbankdatei von der lokalen Website, die Sie im ersten Schritt gespeichert haben.

Import database via phpMyAdmin

Klicken Sie anschließend auf die Schaltfläche „Go“ unten auf der Seite. Ihre Datenbank wird automatisch in phpMyadmin importiert.

Schritt 5: Ändern Sie die URL der Website

Nun müssen Sie die Website-URL in Ihrer Datenbank ändern, damit sie sich mit Ihrer Live-WordPress-Site verbindet.

Suchen Sie in phpMyAdmin nach der Tabelle wp_options in Ihrer Datenbank, die Sie oben importiert haben.

Wenn Sie Ihr Datenbankpräfix geändert haben, könnte es statt wp_options {new_prefix}_options heißen.

Klicken Sie dann auf die Schaltfläche „Durchsuchen“ neben wp_options. Oder klicken Sie auf den Link in der Seitenleiste, um die Seite mit einer Liste der Felder in der Tabelle wp_options zu öffnen.

Browse the wp options table

Dann müssen Sie in der Spalte options_name nach der Option siteurl suchen.

Klicken Sie dann auf das Symbol „Bearbeiten“.

Edit siteurl in phpMyAdmin

Daraufhin öffnet sich ein Fenster, in dem Sie das Feld bearbeiten können.

Im Eingabefeld für option_value sehen Sie die URL Ihrer lokalen Installation, die etwa http://localhost/test lautet .

In dieses Feld müssen Sie die URL Ihrer neuen Website eingeben, z. B. https://www.wpbeginner.com.

Anschließend können Sie das Feld speichern, indem Sie auf die Schaltfläche „Go“ klicken.

edit the siteurl field

Als nächstes müssen Sie die gleichen Schritte wie oben für den Namen der Home-Option ausführen. Das Menü wp_options kann einige Seiten lang sein. Normalerweise befindet sich die Home-Option auf der zweiten Seite.

Aktualisieren Sie dann die Home-URL, damit sie mit der URL Ihrer Live-Site übereinstimmt.

Schritt 6: Einrichten Ihrer Live-Site

Nachdem Sie nun die Datenbank importiert und Ihre Inhalte hochgeladen haben, ist es an der Zeit, WordPress zu konfigurieren.

Zu diesem Zeitpunkt sollte auf Ihrer Website die Fehlermeldung„Fehler beim Herstellen einer Datenbankverbindung“ angezeigt werden.

Um dies zu beheben, verbinden Sie sich mit einem FTP-Client mit Ihrer Website und öffnen Sie die Datei wp-config.php.

Sie werden nach den folgenden Codezeilen suchen:

// ** 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' );

Sie müssen den Datenbanknamen, den Benutzernamen und das Passwort angeben, die Sie zuvor erstellt haben.

Speichern Sie anschließend die Datei wp-config.php und laden Sie sie zurück auf Ihren WordPress-Hosting-Server.

Wenn Sie jetzt Ihre Website besuchen, sollte sie live sein.

Danach müssen Sie sich in Ihr WordPress-Administrationspanel einloggen und zu den Einstellungen “ Allgemein gehen. Dann, ohne etwas zu ändern, scrollen Sie zum Ende und klicken Sie auf die Schaltfläche „Änderungen speichern“.

Save general settings

Dadurch wird sichergestellt, dass die URL Ihrer Website überall dort korrigiert wird, wo sie sein muss.

Wenn Sie das getan haben, gehen Sie zu Einstellungen “ Permalinks, scrollen Sie nach unten und klicken Sie auf „Änderungen speichern“, um sicherzustellen, dass alle Beitragslinks funktionieren.

Save permalinks settings

Wenn Sie eine WordPress-Site von einer Domain auf eine andere oder von einem lokalen Server auf eine Live-Site verschieben, werden Sie mit defekten Links und fehlenden Bildern konfrontiert.

Eine einfache Möglichkeit zur Aktualisierung der URLs ist die folgende SQL-Abfrage:

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

Gehen Sie einfach zu phpMyAdmin, klicken Sie auf Ihre Datenbank und dann auf „SQL“ im oberen Menü und fügen Sie die oben genannte Abfrage hinzu.

Stellen Sie sicher, dass Sie die URLs Ihrer eigenen lokalen Website und der Live-Site ändern und klicken Sie auf die Schaltfläche „Go“.

Fixing WordPress images and broken URLs after moving to live site

Das war’s. Sie haben WordPress nun erfolgreich von Ihrem lokalen Server auf eine Live-Site migriert.

Hoffentlich funktioniert Ihre Live-Website jetzt reibungslos. Wenn Sie Fehler bemerken, können Sie in unserem Leitfaden zu häufigen WordPress-Fehlern nachsehen, um Hilfe bei der Fehlersuche zu erhalten.

Wir hoffen, dass dieser Artikel Ihnen geholfen hat, WordPress von einem lokalen Server auf eine Live-Site umzuziehen. Vielleicht interessieren Sie sich auch für unseren Leitfaden zur Erstellung eines E-Mail-Newsletters oder für unseren Vergleich der besten GoDaddy-Hosting-Alternativen.

Wenn Ihnen dieser Artikel gefallen hat, dann abonnieren Sie bitte unseren YouTube-Kanal für WordPress-Videotutorials. Sie können uns auch auf Twitter und Facebook finden.

Offenlegung: Unsere Inhalte werden von unseren Lesern unterstützt. Das bedeutet, dass wir möglicherweise eine Provision verdienen, wenn Sie auf einige unserer Links klicken. Mehr dazu erfahren Sie unter Wie WPBeginner finanziert wird , warum das wichtig ist und wie Sie uns unterstützen können. Hier finden Sie unseren redaktionellen Prozess .

Avatar

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.

Das ultimative WordPress Toolkit

Erhalte KOSTENLOSEN Zugang zu unserem Toolkit - eine Sammlung von WordPress-bezogenen Produkten und Ressourcen, die jeder Profi haben sollte!

Reader Interactions

909 KommentareEine Antwort hinterlassen

  1. Syed Balkhi says

    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. sam says

    Isn’t it better to use a duplicator plugin instead of taking all this trouble as described in here
    or here
    I think using the duplicator is a easier. Feel free to add or correct me.

  3. fadilah says

    hi, i’m getting a problem with my permalink, my permalink is still pointed to my localhost something like fadil.dev so when i add a post/page, the permalink is pointed to my fadil.dev/?p=ID it should be pointed to fadil.com (my real domain) and not fadil.dev (my local domain) .. where i can find the configuration ? help me .. thankyou :)

  4. prox says

    nice tutorial i was thinking to do and found your website luckily and also i would like to ask two thing

    1. what’s this footer advertisement option is it a plugin ?

    2 what’s the plugin your using for newsletter i saw when i enter to your site there’s nice pop up banner that saying do you want to lean about WordPress and then enter your email address

    please share if you don’t mind

    thank you

  5. Nathan says

    Great help, thanks!

    One question, if I buy a theme, can I use it on both my local and live site even though they are different installations and thus have different WordPress id’s?

    I am building my first live site but I have set up a local to play with the designs and construct the content.

    Thanks.

  6. Matt says

    Hi. Firstly I’d like to thank you, this process was easy to understand and errorless on your end!

    My one hang-up was at the very end. I put in the SQL code in order to fix some linking errors, but must not have put the right local host because some small inconsistencies were not fixed. I have been using MAMP and accessing my site by going to „localhost:8888“ Is this what I should put in that Step 7 code, or is there a different path?

    • WPBeginner Support says

      Matt first you need to make sure that inside your wp_posts table you are using localhost:8888 inside post content. If yes, then use this in the step 7. If you are seeing all your links as localhost, then use localhost.

      Admin

  7. Dayomaks says

    All instructions works fine, thanks, i am so glad, but the issue i am having now is importing my database…while trying to import my database to a live server i got these errors below:

    Error
    SQL query:


    — Database: `soundmode`

    — ——————————————————–

    — Table structure for table `xs_commentmeta`

    CREATE TABLE IF NOT EXISTS `xs_commentmeta` (

    `meta_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
    `comment_id` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT ‚0‘,
    `meta_key` VARCHAR( 255 ) DEFAULT NULL ,
    `meta_value` LONGTEXT,
    PRIMARY KEY ( `meta_id` ) ,
    KEY `comment_id` ( `comment_id` ) ,
    KEY `meta_key` ( `meta_key` )
    ) ENGINE = INNODB DEFAULT CHARSET = utf8 AUTO_INCREMENT =1;

    MySQL said: Documentation

    #1046 – No database selected

    ANY ASSISTANCE ON THERE?

  8. Christie Bellah says

    This worked great, thanks! In the past I had installed WordPress in the new hosting, dropped database tables, imported, etc. – this is so much faster and simpler.

  9. Stefano says

    First of all, thanks for the tutorial – invaluable and well written.

    Unfortunately, I managed to get stuck anyway.
    I uploaded everything via filezilla and phpmyadmin, and when i try to go to my domain it doesn’t show up any error. But nothing else, either.

    Just a blank page – which is weird, because by typing /wp-admin at the end of the url i DO have access to the wordpress control panel, and every page seems to be all right.

    Sorry to bother, but I really have no clue about what’s happening..
    Thanks in advance!

    • Stefano says

      Solved!
      Apparently, it had some issues with the theme loading.
      I couldn’t use the children theme i had worked on, but luckily I had changed just a couple of thing, so no big deal..

      • Stefano says

        I did, and in fact the url worked (even if it showed just a blank page).
        I still have no clue about what happened, but setting up the theme again solved it.
        Lucky shot =P

  10. sesan says

    please am having an error from step 4
    SQL query:


    — Database: `wordpress`

    CREATE DATABASE IF NOT EXISTS `wordpress` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

    MySQL said: Documentation
    #1044 – Access denied for user ‚Admin7393’@’%‘ to database ‚wordpress‘

    • WPBeginner Support says

      Sesan, the export file prepared by phpmyadmin to import into your live site database, contains a line to check if a database exists if not then it tries to create it. To resolve this issue, you need to extract the zip archive you created. Inside it you will find a file with .sql extension. Open this file in a text editor like Notepad and then delete these lines

      CREATE DATABASE IF NOT EXISTS `wordpress` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

      Below this line you will see another line like this

      USE `wordpress`;

      Replace wordpress with the name of the database you are trying to import into.

      Save your changes and put the sql file back into a zip archive (if it is too big, other wise you can also import it as it is).

      Admin

  11. Tyler says

    Hi, thanks for the tutorial!

    I’m struggling with Step 2. Your tutorial shows several files/folders being uploaded whereas I only have wordpress.sql.gz from Step 1. I can’t seem to extract the file using any software but can open using a text editor.

    Any help would be greatly appreciated!

  12. Mario says

    do I need a cpanel to do this procedure? I am using a plugin to backup and export databases already, unfortunately the host provider that the client is using does not have a cpanel.

  13. Rhomy Prama Dhieka (Web Designer) says

    thanks for sharing.
    it help me alot migrating my wp website.
    would you mind if i translte this to my language, then i will put ur credit there ?
    thanks.

  14. ryan says

    hi, i am using stablehost and have used them before with WP websites. I followed all your steps and I am getting a parked page from my hosting provider…

    • WPBeginner Support says

      There can be several reasons for that. First make sure that you have installed WordPress in the root directory of your website. If you did then make a backup of your .htaccess file and delete the one from root directory of your website. If that doesn’t work, then find the default parked page files there might be an index.html file on your web server delete that file (Do Not delete index.php). If none of these help then contact your hosting provider.

      Admin

  15. Alex says

    Thanks!

    I did a search for the ‘‹’ character in the extracted .sql file, but got an alert saying: The string ‘‹’ was not found.

    I don’t know if this matters, but I noticed that my local phpMyadmin version is 5.5.3, while my host’s phpMyadmin version is 3.5.8.2.

    Another note is that I had all my WordPress files already up on my public_html directory (which is your step 2) BEFORE exporting my local WordPress database (which is your step 1). I’m not sure if it makes a difference.

    I’ll try starting over with step 1, as you suggested, and if I get the same error then I may try the Duplicator plugin that you mentioned.

    Alex

  16. PatoPanichelli says

    You really helped me. This step by step is awesome, I had no problems migrating from MAMP to a live site. Thanks

  17. Alex says

    Thanks for the tutorial!

    Everything’s gone well until I get to the end of step 4. When I press the Go button at the bottom of the page, instead of having phpMyadmin import my WordPress database I get an error message that reads as follows:

    #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

    Can you let me know what you think may be causing this?

    Alex

    • WPBeginner Support says

      Alex, it seems like the database file you are trying to import has a character ‚‹‘ which is not supposed to be there. You have two options to fix that, first option is go back to your localhost/phpmyadmin and export your local database again and then try to import it again. If the same error occurs again, then extract your database gzip file using 7zip program. Open the .sql file in a text editor like notepad and look at the first line. Also take a look at our database management using phpMyAdmin guide to learn more.

      Admin

    • Anna says

      Make sure you clicked on the database name on the lefthand side that you’d like to import to. Make sure that is highlighted and then try again. (phpMyAdmin version 4.0.8).

  18. qs says

    I get this error when I import datebase into live site. How do i solve it?

    Error
    SQL query:

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;

    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;

    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;

    /*!40101 SET NAMES utf8 */;


    — Database: `wordpress`

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

    MySQL said:

    #1044 – Access denied for user ‚bossaballsg’@’10.%‘ to database ‚wordpress‘

      • Chathuranga says

        Hi,

        Hope your DB name is „wordpress“

        Change the,
        – Database: `wordpress`

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

        change „wordpress“ to your live DB name. It’s at your sql file.

      • qs says

        I checked and all the privileges are already set to „yes“.

        is it because of the „latin1_swedish_ci“ collation in my database? because the rest of the tables are all in „utf8_general_ci“

      • qs says

        I checked and all the privileges are already set to „yes“.

        is it because of the „latin1_swedish_ci“ collation in my database? because the rest of the tables are all in „utf8_general_ci“

  19. fab says

    hi there,
    totally newbie here. hope you can help with this error message during step 4:
    Error
    SQL query:


    — Database: `information_schema`CREATE DATABASE `information_schema` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    MySQL said:

    #1044 – Access denied for user ‚renta730’@’localhost‘ to database ‚information_schema‘

    When setting this user I allowed all privileges to the database previously created (named „inicial“).
    Any thoughts?

    • WPBeginner Support says

      To change database username and password connect to your live website using an FTP client. Find wp-config.php file and edit it. You will see your database name, database username, and host information. Change it to the database information for your live site.

      Admin

      • Kerry O'Connor says

        I’ve tried every variation of my ‚host url‘ in the wp.config file and uploaded it every time, no avail, still getting ‚Error Establishing db..‘

        Where before it was ‚localhost‘, now it should be ‚mywebsite.com‘, is that right?

        thanks

  20. Changdeo Mhaske says

    Thank You,

    would only make sense if this is a new site. If it is an existing site, then you would have to constantly comment out the hosts file in order to access the live site.

  21. Satyanarayana says

    Hi Dude.
    Actually i followed the process as you explaned above is very nice and clear.
    but i was getting the error „page not found“. when i click on link in a website
    i am changing my files from main server to localserver
    Can you please help

  22. Steve says

    As a beginner, I found this article very helpful, but couldn’t get my site up live after developing locally. Everything was fine until Step 6. I did see the Error Establishing Database Connection error, and then edited the wp-config.php file. However, my site became a blank screen at that stage and I haven’t been able to change it.

    I continued on and went to my WordPress admin panel, and checked Settings » General. They still showed the localhost web address so I changed it to my site url. This is when things turned ugly. I was automatically logged out of WordPress and can’t get back in. In fact, when I ask WordPress to email me a new password to log in, its sends a localhost URL that takes me to a sign-on page with a message that reads „Sorry, that key does not appear to be valid.“ I have no idea what caused that.

    Any help would be greatly appreciated.

      • Steve says

        Thanks for your suggestion. I double-checked and yes I had completed that step. Both have the correct URL

        Part of my confusion is that I now have two databases for this website. I originally had one accessible through a URL that starts with the number of an IP Address/phpmyadmin. Then I have the one I created in Step 3, which I did through my hosting company’s e-panel. They have different passwords and names. But I’ve tried both combinations in the wp-config file and still get the blank screen. Which one of these databases should I be using? They seem to have identical content.

    • Patrick says

      Sparky!
      Your step-by-step guide was spot on. I am a mac user, and after MAMP, I am live now. Thanks a lot. It worked perfectly for me.
      Hat docked!

  23. Vishal Kumar says

    I have done migration form live site to localhost successfully. But I noticed that Comment facility is not there after this. I have also checked all the option in ‚Setting->Discussion‘ page. Everything is cheked but Commenting option and Leave comment box is not visible anywhere in the localhost. Please give me any suggestion for this because I am new in wordpress I am a Zend framework developer basically.

  24. NARESH says

    Instead of moving the wordpress site, I would like to fresh install wordpress using fantastico or hostgator’s quick install, so will I be able to do like this too just by exporting and importing databases and uploading the themefiles? or this is the only way we can do it?

    I don’t know why. my local machine wordpress loads very slow than one, whichever is installed on live server using fantastico or quick install.

    • WPBeginner Support says

      Naresh yes you can import your posts and comments using import/export tools in WordPress, then you can upload theme and other files using FTP. There are multiple ways to do things you need to choose one that works best for you.

      Admin

  25. Mark Jones says

    Do all of these instructions remain the same if there’s already an older, existing, non-wordpress page built where you want to move your wordpress page? For instance, rebuilding an existing site as a wordpress site, then switching over.

  26. Abrishca says

    It’s easy to forget just how much work a good plugin really does for us – I personally use the Duplicator plugin to transfer new websites from my development server to the client’s domain and you can see how much time this plugin (and Backup Buddy) can save you.

  27. Praveen says

    Hi,
    I am facing problem in changing the database after creating the new database.
    Is there any problem with my hosting service or anything else

  28. Anna says

    Are you reading my mind?! Just a little while back I sat down at the computer to figure out how to add a Facebook like button to my first website, currently in development. Whala! „How to add a Facebook like button to your posts“ was that day’s article. Then I’m wondering how to begin the local to live migration today, and AGAIN, here’s this post! GET OUT OF MY HEAD! :)

    And seriously, thank you very much for the invaluable help you’ve given to a beginner like myself.

  29. riaz ali shah says

    great article, the technique i often use for develop wordpress sites for clients, i use dummy text and images for local and then i move my theme only on server.

  30. John Coleman says

    This was a great article. Another option to address the broken links issue is to do a find/replace on your .sql file (in a text editor) of the local URL to the production URL before you import it. This is also handy when moving a site to/from a sub-directory, or to push from staging (e.g. http://staging.domain.com) to production (e.g. http://www.domain.com).

    Thanks for putting this out there. I am sure it will help a lot of people.

  31. David says

    Could have used this article 20 months ago. The trick I discovered in making the move was to open the database file in a good text editor. From there I did a search & replace maneuver to change localhost to the proper URL. It discovered numerous instances without me tracking down the tables, or worrying if my command syntax was correct.

    There’s a plugin called Broken Link Checker that’s worth running as well after the move.

    There are some web-hosting sites who’s infrastructure keeps everything in your WordPress site as localhost. No need to change anything in your local build. Just copy it over. Will definitely chose one of them next time.

  32. Mark says

    2 suggestions to make it easier to move:

    1. When developing locally edit your HOSTS file (c:\Windows\System32\Drivers\etc\hosts) to point your domain name at local server. This avoids having to change the SITE URL and other links/images. Note: this will require config changes to your local web server.

    2. If you have to modify the SITE URL etc, after you have exported the local database and before import, Open the file in notepad and search for all instances of localhost/yourtestsite and replace with http://www.yourlivesite.com

    • Editorial Staff says

      Mark,

      1. would only make sense if this is a new site. If it is an existing site, then you would have to constantly comment out the hosts file in order to access the live site.

      2. Yes that would make sense.

      Admin

  33. Gregg says

    I also recommend DeskTop Server which I have been using for more then a year. Desktop Server allows you to create a local version of your site and then direct deploy it. Awesome!

  34. Sü Smith says

    Great post! I typically just do find and replace on the .sql file with Notepad++ before uploading it to phpmyadmin. This is a nice alternative.

  35. Mike Ott says

    Unfortunately this only works for some sites. A lot of wordpress plugins store serialised data in the database (Gravity Forms is one such plugin), and serialised data isn’t portable so doing an SQL dump and importing via PHPMyAdmin won’t work properly because of the string length differences between your local URL and live domain. You can’t even run an SQL query over serialised data.

    The best thing I’ve found to get around this problem is by using the WP Migrate DB plugin (http://wordpress.org/plugins/wp-migrate-db/). It handles the serialised data problem flawlessly every time and you won’t have to do half the other things you mentioned in this post.

    Have fun.

  36. estudiowp says

    Nice article an well explained steps!

    However, many people will find troubles in their migrations because of the serialized data.

    Some plugins and themes use serialized data, and the replaces in step 5 and step 7 won´t change all the urls and paths that need to be changeed.

    For those steps you could use these tools or plugins:

    · wp migrate db plugin: http://wordpress.org/plugins/wp-migrate-db/

    · search and replace tool: http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    I hope this comment will be useful and sorry for my english!

  37. Jean says

    Great article – best I’ve read on this subject.

    I moved a site a while back and the only thing I would add is that you might need to re-save the permalinks settings. I had to do this because none of my menu links worked so this was an easy fix (luckily!)

    • Mike Ott says

      If anyone wants to know what that happens, it’s the .htaccess file shows a different RewriteRule between local and live.

      A quick edit to .htaccess fixes the problem or as Jean pointed out, re-saving the permalinks settings will also do the trick as it’s just fixing the RewriteRule.

Eine Antwort hinterlassen

Danke, dass du einen Kommentar hinterlassen möchtest. Bitte beachte, dass alle Kommentare nach unseren kommentarpolitik moderiert werden und deine E-Mail-Adresse NICHT veröffentlicht wird. Bitte verwende KEINE Schlüsselwörter im Namensfeld. Lass uns ein persönliches und sinnvolles Gespräch führen.