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. Axel

    I love this entry, I use it as a checklist every time I make a migration.

    • WPBeginner Support

      Hey Axel,

      Glad you find it useful :) Don’t forget to join us on Twitter for more WordPress tips and tutorials.

      Administratör

  3. Gary

    I keep getting stopped at step 4. when I import my datatbase I get the following error

    #1231 – Variable ’character_set_client’ can’t be set to the value of ’NULL’

    I only have limited sql knowledge and never done anything like this before. any help/guidance would be greatly appreciated

  4. Andrew

    Hello,

    So I got to step 6 without any issues until my website failing to become live. I went into my wordpress general setting and my site url was still a localhost. Am I suppose to change the site url before I upload it into the ftp program and into my host, or can i leave that as localhost? Or, do i change the site url in wordpress after i’ve uploaded my files into my hosting site?

    This page was super helpful, thanks!

    • Daneesh

      Hi. Thanks so much for this, excellent tutorial. I seem to have got stopped at Step 6. I am still getting a ”Error establishing database connection” error. DO i need to change the hostname field in the config.php too? and what do i change that to?

  5. Simon

    Amazing, it worked, thank you.

  6. sornanun

    Thank you very much.

  7. Annete Momanyi

    Thank you for the article. I have managed to sort my problem after following these steps.

  8. Arash

    Hello there,

    I have two questions and I’d be grateful if you could help me!

    1) Why do I have two ht-docs and wp-content folders inside my WordPress folder?

    2) When I move my WordPress website from a localhost to the live host, It’s possible to remove my localhost or should I keep it forever?

    Thanks in advance!

    • Matze

      1) By installing WordPress on your hosted server, these docs/folders will be automatically added. I think while uploading your files from local to live via FTP __ht-docs__ and __wp-content__ just weren’t replaced.

      But please check your local files which are normally located in the WAMP/MAMP folders unter __htdocs__ . Are there also two copies of the datas? Then you should find out, which one is the right one …

      2) At the time uploading your files from local to live, the local datas are a backup. After some weeks, changing and editing your live site on the server you can delete the locals.

      But you should create a backup regular and store the datas local (Quote: ”If you are doing this on a regular basis, then we highly recommend that you get BackupBuddy because it will make your life easy. You will thank us for that later”)!

      Hope it helps :)

  9. Starfleet Nnaemeka

    Wow! What a wonderful tutorial , seriously i really appreciate the effort you guys brought out to write these tutorial. Thanks it really helped me to set up my website build on wordpress from localhost on wampserver.

  10. Leo Laroche

    i have followed all the steps, but when i type in my website the old website comes up. Can someone help me please.

  11. rachel asakome

    i have followed steps 1-5, but i am not sure where my site is. sorry it sounds really dumb but i am not great with technology. I have uploaded the files, but when i type in my website the old website comes up

  12. Justas

    server DNS address could not be found.
    ERR_NAME_NOT_RESOLVED

    I changed everything accordingly, but still can’t connect.

  13. Carrie

    Could you please explain on how to do this with webmatrix? I have a PC and my wordpress install on my local PC was with webmatrix. I do not have a MAC. Where on webmatrix do I export? I am confused about this. Also, you have create a db in cpanel my sql. Where do I save this new db? On the cpanel someplace or on my local pc hard drive and under what name? I have a domain with go daddy and a web hosting I purchased. They said to do a brand new fresh install of wordpress from there site…. why would I do this? I already have my wordpress via webmatrix on my local pc this is where the website I built resides. How do I get this on my web hosting? Confused on the db stuff and how to get my local wp files/db to my web host. Thank you.

  14. Neo An

    Very clear!
    Thank you very much!

  15. Milica

    This is a great tutorial. Thanks a lot! :)

  16. Amber

    I have followed all of these steps and when I view my site it is showing my content like words and links but none of the decorative stuff or plugins etc. My menus are showing up as just a list of words as if I created a page without any real CSS. My CSS files are not missing so I do not know where the mess up is happening. I tried to do the part about fixing broken links and I am not 100% of what I should put after the localhost part. I used the name of the folder that my entire wordpress database/files/etc are in. I cannot seam to figure out what is going wrong.

    • Abdul

      @AMBER and all those struggling with the same issue, the problem with the deployment process of WordPress’ database is due to the empirical replacement of your local URI with the live site’s URI as explained in this article at Step 7. If you just execute the UPDATE SQL statement as shown, you, most of the time, end up corrupting your database. Why? The reason is simple: WordPress has a way of serializing some metadata for its own convenience. This post explains it pretty well: nacin.com/2010/04/18/wordpress-serializing-data

      If you look at this array:

      array( ’apple’, ’banana’, ’orange’ ),

      when serialized it looks like this:

      a:3:{i:0;s:5:”apple”;i:1;s:6:”banana”;i:2;s:6:”orange”;},

      where:

      – a:3 stands for ”array of size 3”
      – i:0; i:1; i:2 stand for ”integer index 0; integer index 1; integer index 2″ respectively
      – s:5:”apple” stands for ”string, length 5, data=apple”
      – s:6:”banana” stands for ”string, length 6, data=banana”, etc.

      As you can see, any serialized string is stored along with information about it’s length. So when you do a simple search and replace in your tables, all occurrences will be replaced indeed but the string’s length metadata won’t.

      In the case your local URL’s length equals your live site’s URL length, then you’re lucky; if they don’t match then you’re in trouble.

      The question now is: ”How do I fix this?”. I’m happy to say that, fortunately, there are many plugins that can help you with this but one that’s really simple and good at it is ”Better Search Replace”.

      Simply install this plugin in your local WordPress installation and proceed as explained in this article. The only place where you can safely replace your local URL is in the wp_options table as explained at Step 5.

      Once you’re done installing the plugin, in the admin panel, go to ”Tools, Better Search Replace”, in the ”Search” text box type your local site’s URL (e.g. http://localhost:12345) and in the ”Replace with” text box, type your live site’s URL (e.g. http://www.example.com) and you should be ready to go. Just make sure you don’t include any trailing forward slash ”/” in the URL (at the end like http://localhost:12345/ or http://www.example.com/)

      I hope this explanation was useful and please let me know if it helped.

      Happy coding!

  17. Simon

    Hi,
    Brilliant article and very easy to follow.
    However, as a WordPress virgin I am struggling with the whole concept of having a separate database from the website. I have created everything locally on my PC. But the local PHP Admin will allow me to use however many characters i like in naming my database but my remote server/host (123-reg) will only allow 9 (my original had 11) so…. the database name locally is different from the database name remotely. I have exported the database tables and imported them in to the remote database, renamed my wp-config to point to the new shorter database name with the correct user name and password but i am still getting the ’Error establishing a database connection’
    message. Any suggestions?
    Could the fact that the tables are exported from a database with a different name from the one they are being imported to make a difference?

  18. Gabriel

    Hello I made all of your steps but I can see only a white page. It doesn’t notify me an error.

    I upload everything in a subdirectory of my website. It’s because of that? Is there a solution?

  19. Patrick Hasch

    Great article, if the upload of zipped files doesn’t work try uploading .sql files instead.

    • Tony

      I also faced the same problem.

  20. John James

    Hello. From your step 6, you said we should change database name, user and password. Are we supposed to change the hostname too?

      • John

        Step 3 says nothing about host names.

        • WPBeginner Support

          When you are creating a database on your webhost, you will be able to see the hostname. If you don’t then this means you are using localhost.

  21. Mohd Hasan

    i followed all steps but going to install.php page , someone can help me , i really need your help

  22. Gabor

    Hello!

    i have 500 internal error on server.
    I think the problem is with .htaccess.
    Can u help in this?

    • Dawn

      I am having this same issue. I followed every step exactly, I fixed the wp-config.php file and re-uploaded it, but now when I go to my live site it says,

      ”This page isn’t working

      [my site] is currently unable to handle this request.
      HTTP ERROR 500”

      • Dawn

        I should have said that that is the error I get when I try to go to my wp-admin. When I go to the site itself it’s blank. :(

  23. Axel

    The solution for image references is to execute the following scripts on your DB:
    (I can’t write the real scripts because wpbeginner.com thinks I’m doing SQL injection :\ )

    UPDATE wp_posts to set the value of column guid to the value of function REPLACE(guid, ’http://old.site.url’, ’http://new.site.url’)

    AND

    UPDATE wp_postmeta to SET the value of column meta_value to the value of function REPLACE(meta_value, ’http://old.site.url’, ’http://new.site.url’)

    Also don’t forget to check permissions for wp-content/uploads to ensure you can add more images.

  24. Aimy

    Hi,

    Thanks for this. I did everything as you described. It seemed that everything went well apart the front page that shows nothing but just the navigation menu.
    When I go to the page builder of the front page it shows that there is nothing added there.
    Any advice?

  25. Krishna

    Dear wpbeginner owner

    Its working for me !

    thank you very much!

  26. Philippe

    Damn I’m so lucky wpbeginner exists, I’ve finally managed to get my website to work thanks to this post, I had to fight my way trough (there is an older database-version on my webhosts server) but I did it thanks to you guys!

  27. Umai Hassan

    URL Changing
    I have changed the URL in wp_option table but only home page loads correctly other pages links are still set to localhost/something ??
    What should I do to change all links??

  28. Cos

    Brilliant article – thanks! Got through the process without a hitch first-off :-)))

  29. Dan Odaka

    Hey, after doing all that, when I go to my site I get a page that shows me the index of wordpress and not my site. what do I do?

    • WPBeginner Support

      This could happen due to an incomplete file transfer. Try to upload your WordPress files again.

      Administratör

  30. Sonja

    Hi. thank you very much for this post. It seems to be very helpful and I’ve tried to follow every step, but now that I’m done, when I go to my URL I get a ”Server not found” error (The host shows me a preview with ”under-construction” and their logo, which was online before I uploaded the data and database – shouldn’t I at least get that?). Do you have any ideas where I might have gone wrong, and is it best to delete everything and start again from scratch, or overwrite it, or look for any particular errors?
    Thank you for any help!

  31. Hugues Pinsonneault

    im wondering if you have any recommendation for developing locally new functionalities on a local dev install, while the client can still do updates on the real database.

  32. shah

    Hi
    Thankyou for the details, but i am still not able to get the path of images correct inspite of the changes done … i have my folders in public_html and have my db created …my live website is working fine except for the pic / logos

  33. zarna

    My wordpress site went live but my images are not getting replicated and they aren’t visible. Can you please guide me what should be the images folder structure while uploading it to live ??

    Your help and guidance would be appreciable.. Thank you.

  34. Coil McCoy

    Great post !!!
    Only the last part doesn’t worked for me, the pictures and links still missing !
    Any clue?
    thank you

  35. Vinish Chaudhary

    Hello,
    All great beside this You don’t have permission to access / on this server.Don’t know why it is showing when I try to access my site.I have done all steps like you said but getting this error can anyone please help me to solve this problem.

  36. Sudais

    Instead of this long way,I use a plugin called wp all in one migration,I just need to import a single file using a plugin when I go live and all done,no playing with databases,etc.I think everyone should do that saves alot of time and handywork.

    • hiren

      can u put the demo ..

      thanks.
      hiren patel.

  37. Paul

    Great article ! But I’m still stuck at the last step. Images aren’t showing on my website.

    Well in fact they does, but only on my PC. Everybody else is getting a buggy website.

  38. Farooq Bashir

    Wow .. Great Article sir
    Its Perfect Working.
    Thanks

  39. Bikram Ray

    Hi,

    No doubt; a very useful article. But I got stuck in the last step. I ran the SQL update query but still having issues regarding image path.

    Just one thing; while uploading the file through FTP, I did not upload the wordpress folder (the test folder) rather I uploaded whatever inside it.. So in the server there is only the folders and files directly placed under ’public_html ’

    Regards,
    Bikram

  40. Kay

    DIDN’T WORK!!

    Error
    SQL query:


    — Database: `wordpress`

    CREATE DATABASE IF NOT EXISTS `wordpress` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    MySQL said: Documentation

    #1044 – Access denied for user ’ksalim’@’localhost’ to database ’wordpress’

  41. Damilola

    A very awesome article, it really made a project i was working on for a client already on my local machine easy to move to his server, i mean i literally tried to develop the website all over again and it was such a pain in the ass….Thank you

  42. Tim Vincent

    Thank you so much for this guide. I struggled doing this for some time before finding this. I followed it word for word and all seems to work. I am very grateful!

    • WPBeginner Support

      We are glad you found it helpful. Don’ forget to follow us on Twitter for more WordPress tips and tutorials.

      Administratör

  43. sonu

    hello! syed

    i want to ask you to from where i get the best free wordpress simple attractive theme which laterly i planned to upload on the live server….any help would be much appreciated….thanks…

  44. sonu

    hello! syed

    i want to ask you when we upload the worpress site from locahost to live server….i just want to ask the wordpress having lot of files and inside the wp-content/themes/… having three different types of theme like twenty fourteen,twenty thirteen ,so is it needed to upload all these themes or not….help would be much appreciated…..thnks…..

    • Ridhik

      No,u just upload the theme folder that currently activated in your site.

  45. Andres Paz Soldan

    Thank you! This was very useful!

  46. Lellys

    First of, thank you!

    I did everything and my site is working, but when I need to login on my wp-admin, it show me a blank screen and nothing happens. Any idea?

  47. paddy lutaaya

    thank you for this article i have followed the steps and uploaded my website to c panel but it has failed to work it brings internal error please help me solve this thank you

  48. Phillip Pilkington

    Allgreat advise except step 6. I have not got past this stage, the advice is not clear. My website shows the Error Establishing Database Connection. This next part doesn’t explain anything to me.
    ”To fix this, connect to your website using an FTP client and edit wp-config.php file. Provide the database name, user and password you created earlier in Step 3. Save the wp-config.php file and upload it back to your server. Visit your website, and it should be live now. ”

    I am connect via ftp, then just edit the file….no, nothing happens from here.I open the file in aneditor but I don’t make any changes because it does not show anything about whatis expalined.

    Regards,

    • Tyler Hall

      Hey, I am currently transferring the files as we speak. Not sure if you found a solution yet (hopefully you have its been 15 days) but you should probably change the hostname: /** MySQL hostname */
      define(’DB_HOST’, ’ ’ your hostname before should have been your localhost or similar.

  49. Himanshu

    Thanks for the post. Really helped solve my problem. Although I faced some issues with database importing. After much effort, updating the phpmyadmin version fixed it for me. If possible you could also include common errors in each section, so that a beginner doesn’t get lost. As it happens, most likely you are going to face some error here and there. Other than that great post. Thanks.

  50. Ola

    Hi,

    Thanks for this, the steps are so direct and you made WordPress uploading fun.

  51. Andy

    Hi. When I go to my website it says Welcome to: yourwebsite.com
    This Web page is parked for FREE, courtesy of GoDaddy.com. Do I have to register my domain? I just thought of a random website name to put in for the changing site url step 5. Also when I enter the local host site I get the message the webpage could not be found. What should I do?

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.