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

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


    — Database: `testbtat`

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

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

    • Bunty Gurung

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

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

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

  3. Wanda Serros

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

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

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

    Also when I try to go to admin I get:

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

    I appreciate any help you can give me. Thanks

    Wanda

    • WPBeginner Support

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

      Administratör

    • Wanda Serros

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

      memory=64MB

      and lastly I had to add:

      suPHP_ConfigPath /home/username/public_html

      into my htaccess file.

  4. Wisdom

    thank you. was so helpful

  5. David

    Hi,

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

    Any ideas?

    thanks

    • WPBeginner Support

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

      Administratör

  6. Roanna

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

  7. Sam

    Thanks for your tutorial, its very helpful.

  8. Janeth

    Great tutorial, thank you very much.

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

  9. AM

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

  10. abel kayode

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

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

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

  11. Miriam

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

    • WPBeginner Support

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

      Administratör

      • Miriam

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

  12. Sisira

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

  13. james Daly

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

  14. Bilal Ahmad

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

  15. Kirit Patel

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

  16. mira

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

    • jay

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

      — Database: `XYZ`

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

  17. Terry

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

    • charles

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

    • rahul

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

  18. Jody Hockley

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

  19. Vivek

    Followed the same steps.

    Website got live on server but facing the following problem.

    Menus are not appearing in Admin Panel.

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

    Any idea?

  20. WawanAdie

    Okay. it will be useful thanks

  21. jeret

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

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

    Thanks.

    • Mustafa

      Check for:

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

  22. Miroslava Donchev

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

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

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

    May be that can help somebody else as well.

    Cheers!
    Mira

  23. dhani

    Hi,

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

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

    Thank you.

  24. Jay

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

    • Jay

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

      • WPBeginner Support

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

        Administratör

      • Jigar

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

        Thanks ADMIN,

  25. soon hao ng

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

    Internal Server Error

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

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

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

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

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

    Thanks

  26. tatiana

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

    • WPBeginner Support

      Please contact your webhost this seems like a server configuration issue.

      Administratör

  27. Jose

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

      • Jose

        Thank you!

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

        Jose

        • David

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

          Can anyone advise me on this?

          Thanks

  28. Mai

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

  29. Mai

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

  30. Jack Allen

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

  31. Beth

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

    • WPBeginner Support

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

      Administratör

  32. Verna

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

  33. annie

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

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

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

    excuse me as I am completely new to this…

    thank you

      • annie

        thank you for your reply

      • annie

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

        any idea what might be wrong?

        thanks.

  34. Hitesh

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

  35. Jeff Matt

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

  36. Ravi

    Thanks a lot..

  37. Rajeev

    Many Thanks for this tutorial :)

  38. Jose Luis

    Thanks for all! You save my life! ;)

    • ashish gupta

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

  39. Westy

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

    • clare

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

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

  40. Pomen Yala

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

  41. Heidi Anderson

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

  42. Venkat

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

    • Priyanka

      hey thanks for sharing such awesome tutorial….:)

  43. Samantha

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

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

    — Ho’ at line 1

    Can you help at all??

  44. Quentin

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

  45. Gwen

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

    #1103 – Incorrect table name

    Any ideas on what I might be doing wrong?

    • WPBeginner Support

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

      Administratör

      • Fatima

        How to do so?

  46. Gwen

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

    #1103 – Incorrect table name

    Any ideas on what I might be doing wrong?

  47. Parisa

    Hi,

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

    tnx

    • Jennifer

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

      • Jennifer

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

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

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

      • AWASAE

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

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

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

  48. Shawn

    Correction to your mysql query:

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

    should be..

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

    (The forward slash was missing)

  49. Anna

    Hi,

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

    Anna

  50. swati

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

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.