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

Så här flyttar du WordPress från en lokal server till en Live site (2 metoder)

Många WordPress-användare föredrar att arbeta med sina webbplatser på en lokal server på datorn. På så sätt kan du arbeta privat med din webbplats innan du gör ändringarna tillgängliga online.

Så småningom måste du flytta den till en live-server för att göra den tillgänglig för onlinebesökare. Denna övergång är avgörande för att säkerställa att din webbplats fungerar korrekt på live-webbplatsen.

Vi har arbetat med många lokala webbplatser, så vi var tvungna att lära oss det enklaste sättet att överföra innehåll till levande webbplatser.

I den här artikeln ger vi dig steg-för-steg-instruktioner om hur du flyttar WordPress från en lokal server till en live-webbplats.

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

Varför flytta WordPress från en lokal server till en Live site?

Att bygga din WordPress blogg på en lokal server är ett säkert sätt att testa ändringar på din website utan att påverka besökarna.

När you har slutfört finslipningen av din website är nästa steg att flytta från din lokala server till en live site.

Låt oss visa dig två sätt att flytta din site från en lokal server till en live site.

Den första metoden använder ett plugin för att flytta WordPress och rekommenderas för Beginnare.

I den andra metoden visar vi dig hur du manuellt flyttar WordPress från en lokal server till en live site.

Du kan välja den metod som fungerar bäst för dig:

Innan du flyttar din WordPress webbplats

Du måste ha några saker på plats för att migrera WordPress från en lokal server till en live-server.

Först antar vi att du har en WordPress-webbplats som körs på en lokal server (även kallad localhost) på din dator och att du har full tillgång till den.

Därefter måste du ha ett domain name och ett webbhotell.

Vi har hört otaliga historier från nybörjare som började med dåliga eller gratis webbhotell och ångrade sig. Enligt vår erfarenhet är valet av rätt webbhotell avgörande för att en webbplats ska bli framgångsrik.

För att göra ditt beslut enklare rekommenderar vi att du använder Bluehost. De är ett officiellt rekommenderat webbhotell för WordPress, och de ger WPBeginners användare en exklusiv rabatt + gratis domän och SSL.

I grund och botten kan du komma igång för så lite som $ 1.99 per månad.

Om du vill ha ett bra Bluehost-alternativ kan du titta på Hostinger. De erbjuder också en exklusiv rabatt till WPBeginners användare med ett gratis domain name.

Om du har råd att betala lite mer, kontrollera då SiteGround. De har också ett specialerbjudande för WPBeginners läsare.

Om du behöver hjälp med att skapa din website kan du följa vår Step-by-Step guide om hur du skapar en website.

Slutligen behöver du ett FTP-program och veta hur du använder FTP för att uppladda din lokala server till live-sajten.

Är du redo? Låt oss börja flytta din WordPress site.

Video Tutorial

Subscribe to WPBeginner

Om du föredrar skriftliga instruktioner är det bara att fortsätta läsa.

Metod 1: Överför WordPress från den lokala servern till Live Site med hjälp av ett tillägg för migrering (rekommenderas)

Den här metoden är enklare och rekommenderas för Beginnare. Vi kommer att använda ett plugin för WordPress-migrering för att flytta WordPress från localhost till en live site.

Step 1: Installera och konfigurera tillägget Duplicator

Först måste du installera och aktivera pluginet Duplicator på din lokala site. För mer detaljer, se vår Step-by-Step guide om hur du installerar ett plugin för WordPress.

Pro tips: Det finns också en Pro-version av Duplicator som erbjuder säkra backups, molnlagring, enkel återställning av webbplatser och mer.

Vid aktivering måste du gå till Duplicator ” Packages page och klicka på knappen ’Create New’.

Create new package for migration

Då kommer du till en vy där du kan ge din backup ett namn.

Klicka sedan på knappen ”Next”.

Name backup package

Duplicator kommer nu att runna några tester för att se om allt är i order.

Om alla punkter är markerade med ”Bra” klickar du på knappen ”Bygg”.

Build package

Denna process kan ta några minuter, beroende på storleken på din webbplats. Du måste lämna den här fliken öppen tills den är klar.

När du är slutförd ser du alternativ för download av paketen ’Installer’ och ’Archive’. Du måste klicka på länken ”One-Click Download” för att ladda ner båda filerna till din dator.

Download package files

Filen ”Archive” är en komplett kopia av din WordPress site. Den innehåller alla WordPress core-filer samt dina images, uploads, themes, plugins och en backup av din WordPress database.

Filen ”Installer” är ett skript som kommer att automatisera hela migreringsprocessen genom att packa upp archive-filen som innehåller din website.

Step-by-Step 2: Skapa en Database för din Live WordPress website

Innan du kan runna installeraren eller uploada WordPress-webbplatsen från localhost till ditt webbhotell måste du skapa en MySQL-databas för din new live website.

Om du redan har skapat en MySQL-databas kan du hoppa över det här steget.

För att skapa en database måste you gå till cPanel dashboard på ditt webbhotell account. Leta sedan upp sektionen ”Databases” och klicka på ikonen ”MySQL Database Wizard”.

MySQL Database Wizard

På nästa vy finns det ett fält för att skapa en new database.

Ange bara ett namn på din database och click på knappen ”Create Database”.

Name new database

cPanel kommer nu att skapa en new database åt you.

Efter det måste du enter ett användarnamn och password för din nya användare och sedan click the ”Create User” button.

Create new database user

Nu måste du add to den användare som du just skapat till databasen.

Klicka först på checkboxen ”All Privileges”.

Check all privileges

Sedan rullar du ner och klickar på knappen ”Make Changes” för att save your changes.

Din database är nu redo att användas med din site WordPress. Se till att du obs/observerar databasens namn, användarnamn och password. Du kommer att behöva denna information i nästa steg.

Steg 3: Ladda upp filer från den lokala servern till WordPress-webbplatsen i realtid

Nu måste du uploada archive- och installer-filerna från din lokala site till ditt webbhotell.

Anslut först till din Live site med hjälp av en FTP-klient. När du har anslutit, se till att rotkatalogen på din website är helt tom.

Normalt sett är root directory foldern /home/public_html/.

Vissa webbhotell för WordPress installerar WordPress automatiskt när du registrerar dig. Om du har WordPress-filer där måste du ta bort dem.

Efter det kan du uploada archive.zip och installer.php-filerna från Duplicator till din tomma root directory.

Upload archive and installer files

Steg 4: Run på migreringsskriptet

Följ efter att du har uppladdat migreringsfilerna, du måste besöka följande URL i din webbläsare:

http://example.com/installer.php

Glöm inte att ersätta ”example.com” med ditt eget domain name.

Detta kommer att starta migreringsguiden för Duplicator.

Installern kommer att runna några tester och initiera skriptet.

Duplicator migration wizard step 1

Under Setup section kommer du att bli ombedd att enter din MySQL server, databasnamn, användarnamn och password.

Din värd kommer troligen att vara en lokal värd. Därefter anger du uppgifterna för den databas som du skapade i det tidigare steget.

Klicka sedan på knappen ”Validate” för att kontrollera att de detaljer du har enter är korrekta.

Validate settings

Därefter klickar du på knappen ”Nästa” för att fortsätta.

Duplicator importerar nu din WordPress backup av databasen från archive till din new database.

Den kommer också att uppdatera webbadresser som pekar på den lokala webbplatsen och din nya live-webbplats.

You can now click on the ”Admin Login” button to enter the WordPress admin area of your live site.

Admin login

När du loggar in på din live site kommer Duplicator automatiskt att städa upp installationsfilerna.

Nu är allt klart. Du har utan problem flyttat WordPress från den lokala servern till din live site.

Metod 2: Överför WordPress manuellt från den lokala servern till Live-webbplatsen

I den här metoden visar vi hur du manuellt flyttar WordPress från den lokala servern till din live site. Det är användbart om den första metoden inte fungerar eller om du föredrar att göra det manuellt.

Step-by-Step: Exportera lokal WordPress Database

Det första du behöver göra är att exportera din lokala WordPress database. Vi kommer att använda phpMyAdmin för att göra det.

Om du inte är bekant med det kan du läsa vår guide till hantering av WordPress Database med phpMyAdmin.

Gå till http://localhost/phpmyadmin/ och klicka på your WordPress database. Därefter klickar du på knappen ”Exportera” högst upp i menyn.

Export from localhost

I alternativet ”Exportmetod:” kan du välja ”Snabb” eller ”Anpassad”. Custom ger dig fler alternativ för att exportera din databas.

Men vi rekommenderar att du väljer ”Quick” och sedan klickar på knappen ”Go” för att downloada din database.

Export WordPress database using phpMyAdmin

Step 2: Uppladda WordPress-filer till Live Site

Nu måste vi flytta all your website-filer till live site.

För att komma igång öppnar du din FTP-klient och ansluter till ditt konto på webbhotellet.

När du är ansluten till din live-webbplats ska du se till att du laddar upp filerna i rätt katalog. Om du till exempel vill att webbplatsen ska hostas på ”dinsite.com” ska du ladda upp alla filer i din public_html-katalog.

Välj nu dina lokala WordPress-filer och uploada dem till din live server.

Upload WordPress files FTP

Step-by-Step 3: Skapa en MySQL Database på din Live site

Medan din FTP-klient uppladdar dina WordPress-filer kan du börja importera din database till live-servern.

De flesta WordPress-hostingleverantörer erbjuder cPanel för att hantera ditt hostingkonto, så vi kommer att visa dig hur du skapar en databas med hjälp av cPanel.

Först måste du logga in på din cPanel dashboard och click på ”MySQL Database Wizard” icon, som finns i ”Databases” section.

Select MySQL database wizard

På nästa vy kan du skapa en new database.

Du måste ange ett namn för din databas och sedan klicka på ”Create Database”.

Name and create new database

cPanel kommer nu automatiskt att skapa en new database åt you.

Därefter måste du ange ett användarnamn och lösenord för din nya användare och sedan klicka på ”Create User”.

Create new database user

Efter det måste du add to den användare du just skapat till databasen.

Kontrollera först checkboxen ”All Privileges”.

Check all privileges checkbox

Sedan rullar du ner och klickar på ”Make Changes” för att save your changes.

Du har utan problem skapat en new database för din live WordPress site.

Step 4: Importera WordPress Database till Live Site

Nästa steg i processen är att importera din WordPress database.

Gå till din cPanel-instrumentpanel, bläddra ner till avsnittet ”Databaser” och klicka på ”phpMyAdmin”.

Click on phpMyAdmin

Detta tar dig till phpMyAdmin, där du vill klicka på databasen som du just skapade ovan. phpMyAdmin visar din nya databas utan tabeller.

Klicka sedan på tabben ”Import” högst upp i menyn. På sidan import klickar du på knappen ”Choose File” och väljer sedan database-filen från den lokala site som du saved i det första steget.

Import database via phpMyAdmin

Därefter klickar du på knappen ”Go” längst ner på sidan. Din database kommer automatiskt att importeras till phpMyadmin.

Step 5: Ändra URL:en för webbplatsen

Nu måste du ändra webbplatsens URL i din database så att den ansluter till din live WordPress-webbplats.

I phpMyAdmin letar du efter wp_options-tabellen i din database som du just importerade ovan.

Om you changed your database prefix, then instead of wp_options, it might be {new_prefix}_options.

Klicka sedan på knappen ”Browse” bredvid wp_options. Eller klicka på länken i sidebaren för att öppna upp den page som innehåller en lista över fälten i tabellen wp_options.

Browse the wp options table

Sedan, i options_name column, måste du leta efter alternativet siteurl.

Klicka sedan på ikonen ”Edit”.

Edit siteurl in phpMyAdmin

Du får upp ett fönster där du kan edit:a fältet.

I inmatningsrutan option_value ser du webbadressen till din lokala installation, som kommer att vara något i stil med http://localhost/test.

Du måste infoga din nya site URL i detta fält, till exempel: https: //www.wpbeginner.com.

Sedan kan du save fältet genom att clicka på knappen ”Go”.

edit the siteurl field

Därefter måste du följa samma steg som ovan för namnet på hemalternativet. Menyn wp_options kan vara några pages lång. Vanligtvis kommer home page-alternativet att finnas på den andra sidan.

Uppdatera sedan hem-URL:en så att den är densamma som URL:en för din live site.

Step-by-Step 6: Konfigurera din Live site

Nu när du har importerat databasen och uppladdat ditt content är det dags att konfigurera WordPress.

Just nu bör din site visa felmeddelandet”Error establishing a database connection”.

För att fixa detta ansluter du till din website med en FTP-klient och öppnar filen wp-config.php.

Du kommer att leta efter följande rader med kod:

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

Du måste ange namnet på databasen, användarnamnet och passwordet som du skapade tidigare.

Save sedan filen wp-config.php och uploada den tillbaka till ditt WordPress webbhotell server.

Nu, när you besöker your website, ska den vara live.

Efter det måste du logga in på din WordPress adminpanel och gå till Settings ” Allmänt. Sedan, utan att ändra något, rullar du längst ner och klickar på knappen ”Save Changes”.

Save general settings

Detta kommer att se till att din sites URL är korrekt på alla andra ställen där den behöver vara.

När du har gjort det, gå till Settings ” Permalinks, rulla sedan ner och klicka på ”Save Changes” för att säkerställa att alla länkar till post fungerar bra.

Save permalinks settings

När du flyttar en WordPress-webbplats från en domän till en annan eller från en lokal server till en live site, kommer du att stöta på brutna links och saknade images.

Vi visar dig två sätt att uppdatera webbadresser. Du kan välja det som fungerar bäst för dig.

1. Uppdatera webbadresser med hjälp av Search & Replace Everything Plugin (rekommenderas)

Det säkraste sättet att åtgärda detta är att använda Search & Replace Everything. Det är ett kraftfullt WordPress-plugin som gör att du enkelt kan utföra massuppdateringar på din webbplats utan att skriva komplexa databasfrågor.

Först måste du installera och aktivera pluginet Search & Replace Everything.

Efter aktiveringen går du till sidan Verktyg ” WP Search & Replace.

Search and replace URLs from local to live site migration

Därefter måste du ange webbadressen till din lokala webbplats i fältet ”Sök efter” och webbadressen till din live-webbplats i fältet ”Ersätt med”.

Bläddra lite och klicka på ”Välj alla” under tabellerna. Detta säkerställer att insticksprogrammet letar efter den gamla webbadressen överallt i databasen.

Select tables

Klicka nu på knappen ”Förhandsgranska Sök & Ersätt” för att fortsätta.

Pluginet söker i din databas efter alla förekomster av den gamla URL:en och förhandsgranskar sedan resultaten.

Preview changes

Om allt ser bra ut klickar du på ”Replace All” för att spara ändringarna.

Du kommer att se en varning om de ändringar du gör. Klicka på ”Ja” för att fortsätta.

Pluginet kommer nu att uppdatera databasen och ersätta lokala webbadresser med din nuvarande webbadress.

2. Uppdatera webbadresser manuellt (Avancerat)

Ett annat sätt att uppdatera webbadresserna är att använda följande SQL-fråga:

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

Gå bara till phpMyAdmin, klicka på din databas och klicka sedan på ”SQL” i toppmenyn och lägg till frågan ovan.

Se till att du ändrar URL:erna till din lokala webbplats och din live-webbplats och klicka på knappen ”Go”.

Fixing WordPress images and broken URLs after moving to live site

Nu är det klart. Nu har du utan problem flyttat WordPress från din lokala server till en live site.

Förhoppningsvis är din live-webbplats igång och fungerar smidigt. Om du upptäcker några fel kan du kolla in vår guide till vanliga WordPress-fel för att få hjälp med felsökning.

Vi hoppas att den här artikeln hjälpte dig att flytta WordPress från en lokal server till en live-webbplats. Du kanske också vill se vår guide om att flytta en live-webbplats till en lokal server eller titta på den ultimata checklistan för webbplatsmigrering för praktiska steg för WordPress-migrering.

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.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

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.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

909 kommentarerLämna ett svar

  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. WPBeginner Staff

    You can try deactivating all the plugins at once by renaming the /wp-content/plugins directory. Here is a tutorial.

    Usually plugins store settings in WordPress database so hopefully most of your settings will not get affected by the change.

  3. Neville Campher

    I have moved my site from one domain to another, but my all my plugins are not working. If I re-install the plugins I will loose my settings, is there a way to keep my setting without loosing them

  4. orangedrum

    I’m wondering the same thing. Just uploading my files didn’t work and when I try and re-export the database I’m getting an error telling me these databases already exist. Help!

  5. santhosh

    thanks a lot it was easy and helpful for any beginner like me

  6. Ajay Walia

    Thanks wpbeginner.com. i got an Error Establishing Database Connection error (local host to server). then i found your post on google. now i solved this error. :)

  7. David A. Bennett

    Awesome tutorial! Just wondering, if I continued to develop on my website locally, could I simply re-upload the new files (’m guessing the wp-content folder) via FTP to my site, or would I need to re-export the database everytime?

  8. Naveen Mallikarjuna

    After trying another method, I tried your method outlined above and it worked perfectly. Thanks much!

  9. WPBeginner Staff

    are you sure you have your site URL as your mysql host? it is usually localhost or a subdomain on your site like mysql.example.com. If you are unsure ask your hosting provider.

  10. Chandara Tieng

    Thank you WPBeginner, now every thing are working fine with your guide.

  11. Chandara Tieng

    ”Error establishing a database connection” I am getting this problem and now not yet fixed.

    here is my configuration in wp-config.php
    <>
    please help me define problem and fixed this.
    Thank ahead for kindness.

  12. ben

    I quite appreciate your article but i have few problems. i have succesfully uploaded my site but the site is not recognising the style sheet and my admin page is blank after i logged in. what is the way out please?

  13. Anjali

    Thank you for this guide. You mention that a plugin such as Backup Buddy or Duplicator can be used to make the migration easier. I’m VERY new to using WordPress, so the answer to this question may be painfully obvious. Would you install the plugin to the local site or the live site before the migration?

  14. Wasim

    After completing all the above steps , do in need to replace my index.html file

  15. Roland

    First off: thanks a lot for your great blog – it gave me the idea to try WAMP to develop my three current WP site projects!!

    I did not install WP on localhost yet, because i am wondering if there could be a problem when I use a multisite installation during the move to the live server of my client.

    I would like to develop the 3 sites for my client in one single database through the WP multisite feature. However i am unsure if everything will be fine when going live because I intend to use an alternative multisite installation method by mapping the three distinct domains onto one SQL database (via this plugin: http://wordpress.org/plugins/wordpress-mu-domain-mapping/). I.e. I want to develop example1.com + example2.com + example3.com on my localhost in a multisite setup and export the sites later onto the production server.

    If someone could clear my doubts as to whether this could be a potential source for problems later on, please do so. :)

    In that case i would develop 3 separate instances of wordpress, although i would like to avoid this at all costs.

    Thank you! Roland

  16. dpi

    It works fine. Awesome guide. Thanks WPB

  17. Jørgen Wolf

    I loved this. Very good guide. Thank you very much, my site is now online!

  18. Ramo

    Thank you very much

  19. WPBeginner Staff

    The most probably cause is that your new database is empty, WordPress successfully connects to your new database. Then it finds out that the database is empty and assumes that its a new site. What you need to do is to import your old database. After that you will need to change your sitename and site url and update your links. See this guide.

  20. John Kiathe

    That was a nice guide. Thank you.

  21. Crocker27

    Hi,

    Great tutorials thanks very much! I’ve created my own theme from scratch and am just in the final stages of putting it online, but I have hit a snag…

    What could cause the 5 minute install page to come up when I direct my page to the new sql database?

    I have exported the SQL database from my localhost. Created a new database on the server and imported it there and I changed the wp-config file to direct to the new database. When I did that I was directed to the 5 minute install page.

    When I leave it on the old database, my theme works (although the content/posts/menus etc are all wrong) so I don’t understand what I’ve done. I am guessing it’s something wrong with the database but I have no idea what!

    Thanks for your help!

  22. Paul Seidel

    I’ve uploaded my website multiple times to the FTP, changed the wp-config, the SQL databases, etc – but for some reason ”wordpress” is still in the address ( , etc.) and I can’t log into the backend. Help !

    • Christopher

      i have the same problem

  23. WPBeginner Staff

    Those changes will be lost if you uploaded an older version of the database from your local server.

  24. Andrew Avantgardian

    Worked like a charm, except i didn’t even need the last step (the MySQL query) for some reason all my links and pictures were fine after the transfer, perhaps it has something to do with the new version of WordPress.

    Anyways thanks for this guide

  25. Naveed

    Thanks a lot for the tutorial. I was mislead by some plugins claiming automatic transfer.

    Excellent work. Keep it up.

  26. WPBeginner Staff

    This article assumes that your live site is actually developed on localhost, so it does not assume that you have already taken down a live site to to work on it.

    In case you are working on a live site by creating a local copy on your computer. Then this strategy is usually used to only work on site’s layout, adding new features, or testing some functionality. This way you can work on your website without modifying any data and when you move the site from localserver to livesite your database usually remains unchanged.

    Hope this helps

    • npp07

      Thanks, but do you have any articles to recommend on how (if possible) to make changes to a website with a community contribution aspect (comments, forums, etc) and be able to develop to include creating posts (not just used for a blog, but something like BuddyPress or Symposium) without overwriting comments added between development versions?

      • Guest

        Yse Livefyre and Disquss comment system

    • npp07

      I thought I replied, but I don’t see it here… by adding new features, do you mean like adding pages and posts using BuddyPress? If a conversation keeps going on the live site while I am developing, will those conversations be lost or merged when I upload to the live site?

  27. npp07

    Thanks for the great article, I have done this with a static site before, but in the article you say this is how WPBeginner.com does it daily (but with BackUpBuddy). I haven’t used BackUpBuddy yet, but plan to for a new project.

    My question is how does this work for a site with the community commenting? Wouldn’t you lose the comments already on the database if you repeat this process daily and overwrite a database? Is there a slightly different step involved for building development updates onto an already live site?

  28. Husnain

    All works fine .. but my header image not work (Crash) .. and when i save permalink in setting it says Connection not established !! :(

  29. Jenna

    Hello!

    When I try to import gripped database I get:

    SQL query:


    — Database: `wpdb`

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

    — Table structure for table `wp_commentmeta`

    CREATE TABLE `wp_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:

    #1046 – No database selected

    How can I fix this?

    Thanks,

    Jenna

  30. landi

    clean and simple

  31. Changa Masomakali

    This is a great article!! Thanks so much for it. But I am not able to pull my site up. I think it has something to do with with the DB Hostname in the wp-config file. What should this be?

  32. Bloodico

    This is absolutely a great article !! THANK YOU !!
    It would be perfect if you mentioned to also check the wp_postmeta when replacing ’localhost/test/’ by ’www.yourlivesite.com/’ on step 7
    and added a Step 8 for the.htaccess file which have to be modified too (if it isn’t done automatically ?)

    the line ”RewriteBase /test/” has to be suppressed and the line ”RewriteRule . /test/index.php [L]” has to be changed to ”RewriteRule . /index.php [L”
    Once again a BIG thank you for this great article that made my day so easy !! ;)

    • B-Designs

      This was exactly the fix I needed for my clients site.
      Thank you so much for your insight

  33. David

    Im having issues logging in to my admin panel. Site displays correctly but links dont work even after executing the sql script. When I try to log in, no error is returned, the form just clears. Any ideas?

  34. Miguel Leite

    Hey there.
    Wonderful post!! Thanks a lot, helped me doing this for my very first time, correctly.

    I’d like to ask: to do the reverse: moving wordpress from live site to local site, I just have to do de process starting with the live server and ending in the local?

  35. Transient

    thanx a lot

  36. Hardeep Kaur

    Thank you very much !!! really helpful.

  37. nickesh

    i complete all the steps but wp-admin page cannot be accessed and it shows following error

    Warning: Cannot modify header information – headers already sent by (output started at /home/sulakasa/public_html/sulakasa/wp-content/themes/CherryFramework/includes/less-compile.php:155) in/home/sulakasa/public_html/sulakasa/wp-includes/pluggable.php on line 1121

  38. WPBeginner Staff

    WordPress.com is still managing your domain name. You can transfer your domain’s registration to your new webhost. Or you can simply update nameserver information for your domain on WordPress.com and point it to your new webhost. Please see the instructions in our guide on how to properly move your WordPress.com blog to WordPress.org

  39. jellman

    I’m confused, is this to also migrate posts? I have a wordpress site developed locally but with zero content yet. therefore can’t I just install wordpress on my dreamhost site, then move the theme files on my computer to the live server?

    • Mawuli

      I have already exported my wordpress.com site to wordpress.org during the installation as your tutorial guided me.
      But my problem is, I already have a domain with wordpress.com and when i was trying to move my site to live, i received those feedbacks….May i know if wordpress.com is still my host or i need to purchase another hosting account?

  40. Mawuli

    I have a domain with wordpress.com. After successfully installing wordpress with wampserver through your tutorial, I managed to design a new website, uploaded and used all the necessary plugins.

    Now, the next thing I want to do is to move to a live site and that’s why I arrived here to be able to display my new site but am stucked in the first step.

    I am using File Zilla as my FTP client. I was asked to enter my host name which I did with the name (wordpress.com). I entered my username, password and port number (21). But this is what I get when I try to connect

    ”Error: Connection timed out

    Error: Could not connect to server”

    What shall I do? Do I need to buy a hosting service or wordpress.com is still my host. I don’t seem to get this hosting thing at all. Explain this to me.
    Thanks you

  41. MHK

    All the steps in this work as expected….WONDERFUL!!!!, however it should be include in this tutorial as Step One or Prerequisite………That we need to install wordpress from Softaculous and then delete the database created by it and import the database into it and after installing wordpress from softaculous should import the WP files from FTP.
    I am facing a strange error. Chrome is opening my website as expected……IE keeps showing the Under construction page?? Any thoughts will be highly appreciated…….I have deleted the index.html file

  42. Yazz Am

    Hello, I get ’Error establishing a database connection’ at step 6 when I try to login to my wordpress admin panel. Help please.

  43. Ferdinand

    I want to set up a site on local host which I want to manage locally. I would write the articles and upload them to webhost after I write them. Do I need to update the site and php database in the way that you mentioned above every single time I write a post? Or is there any way to upload only the files that got changed? This I want to know since it would be very time saving to manage the site offline for me.

  44. Rizky M R

    My site has working, but i can’t open any page and post of my website, and also the image still doesn’t show up after the sql query fix

  45. Charlie Barnett

    Hi, I have found your explanation extremely useful and have managed to trasnfer my locally hosted wp site live. However when I try step 6 to login I can’t seem to login and it throws the following error:

    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.

    Does this make sense have I missed something in my upload?

    Thanks Charlie

  46. wanda serros

    My site is up but it’s still not completely functional. When I click on some of my images to get an enlarged view I get a message saying ’The requested content cannot be loaded. Please try again later.’

    I’ve looked in my database and I see that there are still instances of ’localhost’…. in some fields. I did run the Update to ’post_contents’ query already. Should I run additional queries to change every mention of ’localhost’ in the database to my website address?

    Thank you. Your site has been very helpful.

    • Timothy

      Ofcourse, replace every instance of localhost and localhost/

  47. Lisa

    I figured out how to upload the database, finally. made those text editor changes within the sql file first. Now I’ve done all of the other steps, including changing the wp_options ”home” and ”siteurl” … and also editing the wp_config.php file from within my live c panel file manager and making those updates. I still get an ”error establishing database connection”. I did notice when I installed wordpress on my new hosted site, it created its own database (ss_1). Should i delete that one?

    • WPBeginner Support

      The most common reason for the error is usually incorrect password, database, username or host information. It has nothing to do with other databases on your mysql server, so there is no need to delete them. Make sure you are entering correct information for your database in your wp-config.php file.

      Administratör

  48. Karlo

    I followed your instructions to make a local copy of my live website (the other way around).

    The only problem I’m experiencing is that the stylesheet isn’t loading and that my images arent showing up, not even on WP backend.

    Do I need to run another SQL query to fix this?

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.