{"id":41708,"date":"2024-09-07T12:00:48","date_gmt":"2024-09-07T09:00:48","guid":{"rendered":"https:\/\/coma.lv\/2024\/09\/07\/how-to-move-wordpress-from-a-local-server-to-a-live-website\/"},"modified":"2024-09-07T12:00:48","modified_gmt":"2024-09-07T09:00:48","slug":"how-to-move-wordpress-from-a-local-server-to-a-live-website","status":"publish","type":"post","link":"https:\/\/coma.lv\/en\/2024\/09\/07\/how-to-move-wordpress-from-a-local-server-to-a-live-website\/","title":{"rendered":"How to Move WordPress from a Local Server to a Live Website"},"content":{"rendered":"\n<p style=\"text-align: left;\">Using a local server can speed up WordPress site development. We have already shown you how to <a href=\"https:\/\/coma.lv\/en\/2024\/08\/22\/how-to-install-wordpress-on-your-pc-using-wamp\/\">install WordPress on Windows using WAMP<\/a> and on Mac using MAMP. When you have finished developing on the local server, the next step is to take the site online. In this article we will show you how to move WordPress from a local server to the internet. Using this method, you can migrate all of your content (posts, pages, images and so on), themes and plugins from the local server to a live website.<\/p>\n<p style=\"text-align: left;\">Before we begin, we have to admit that plugins such as <a href=\"https:\/\/wordpress.org\/plugins\/all-in-one-wp-migration\/\" target=\"_blank\" rel=\"noopener\">All-in-One WP Migration<\/a>, <a href=\"https:\/\/wordpress.org\/plugins\/wpvivid-backuprestore\/\" target=\"_blank\" rel=\"noopener\">WPvivid Backup<\/a> and <a href=\"https:\/\/wordpress.org\/plugins\/duplicator\/\" target=\"_blank\" rel=\"noopener\">Duplicator<\/a> can make a migration from a local server much easier. In this article we will show how to move WordPress from a local server manually so that you can understand the whole process.<\/p>\n<h2 style=\"text-align: left;\">Before You Start<\/h2>\n<p style=\"text-align: left;\">To migrate your locally developed WordPress site to an online server, you need two things. The first is a local server. We assume that you use WordPress on a local server and have full access to it. The second is web hosting that supports WordPress, to which you will move your content.<\/p>\n<p style=\"text-align: left;\">You also need an FTP program and need to know how to use it to upload your content to the live site.<\/p>\n<p style=\"text-align: left;\">Note: the screenshots in our article were taken on hosting providers that have cPanel.<\/p>\n<h2 style=\"text-align: left;\">Step 1: Export the Local WordPress Database<\/h2>\n<p style=\"text-align: left;\">First you need to export your local WordPress database. To do this we will use phpMyAdmin. If you are not familiar with it, you can read <a href=\"https:\/\/coma.lv\/en\/2025\/07\/16\/managing-a-wordpress-database-with-phpmyadmin-a-beginners-guide\/\">our guide on how to manage a WordPress database using phpMyAdmin<\/a>. Just go to http:\/\/localhost\/phpmyadmin\/ and click your WordPress database. Then click the <em>Export<\/em> button in the top menu.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10355\" src=\"https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/export-tab-phpmyadmin.jpeg\" alt=\"export-tab-phpmyadmin\" width=\"518\" height=\"92\" title=\"\" srcset=\"https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/export-tab-phpmyadmin.jpeg 518w, https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/export-tab-phpmyadmin-300x53.jpeg 300w\" sizes=\"auto, (max-width: 518px) 100vw, 518px\" \/><\/p>\n<p style=\"text-align: left;\">For the <em>Export Method<\/em>, choose the custom option, which gives you more export options. Select all tables for export and gzipped for compression. Scroll to the bottom of the page and click the <em>Go<\/em> button to download your database.<\/p>\n<h2 style=\"text-align: left;\">Step 2: Upload the WordPress Files to the Website<\/h2>\n<p style=\"text-align: left;\">Now open your FTP client and connect to your site. Once connected, make sure you upload the files to the right directory. For example, if you want to host your site at yoursite.com, you should upload all the files to the public_html directory.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10356\" src=\"https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/uploadingwordpress.jpg\" alt=\"uploadingwordpress\" width=\"520\" height=\"350\" title=\"\" srcset=\"https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/uploadingwordpress.jpg 520w, https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/uploadingwordpress-300x202.jpg 300w\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" \/><\/p>\n<p style=\"text-align: left;\">Now select your local WordPress files and upload them to the live server.<\/p>\n<h2 style=\"text-align: left;\">Step 3: Create a MySQL Database on the Website<\/h2>\n<p style=\"text-align: left;\">While your FTP client is uploading the WordPress files, you can import your database to the live server. Most WordPress hosting providers offer cPanel for managing your hosting account, so we will show how to create a database using cPanel. Log in to cPanel and click the Manage My Databases link in the databases section.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-35670 size-full\" src=\"https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-041014.jpg\" alt=\"createdatabasecpanel\" width=\"1175\" height=\"272\" title=\"\" srcset=\"https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-041014.jpg 1175w, https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-041014-300x69.jpg 300w, https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-041014-1030x238.jpg 1030w, https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-041014-768x178.jpg 768w, https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-041014-705x163.jpg 705w\" sizes=\"auto, (max-width: 1175px) 100vw, 1175px\" \/><\/p>\n<p style=\"text-align: left;\">In the next window, enter the name of your new database.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-35673 size-full\" src=\"https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-042154.jpg\" alt=\"createnewdb\" width=\"795\" height=\"220\" title=\"\" srcset=\"https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-042154.jpg 795w, https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-042154-300x83.jpg 300w, https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-042154-768x213.jpg 768w, https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-042154-705x195.jpg 705w\" sizes=\"auto, (max-width: 795px) 100vw, 795px\" \/><\/p>\n<p style=\"text-align: left;\">After creating the database, scroll down to the Database Users section and create a user or add an existing user to the database. After that cPanel will show you a list of MySQL privileges for this user. Just select all privileges.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-35676 size-full\" src=\"https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-042652.jpg\" alt=\"newdbuser\" width=\"981\" height=\"796\" title=\"\" srcset=\"https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-042652.jpg 981w, https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-042652-300x243.jpg 300w, https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-042652-768x623.jpg 768w, https:\/\/coma.lv\/wp-content\/uploads\/2025\/07\/Ekranuznemums-2025-07-03-042652-705x572.jpg 705w\" sizes=\"auto, (max-width: 981px) 100vw, 981px\" \/><\/p>\n<h2 style=\"text-align: left;\">Step 4: Import the WordPress Database to the Website<\/h2>\n<p style=\"text-align: left;\">The next step in the process is importing the WordPress database. Go to cPanel, scroll down to the databases section and click phpMyAdmin. This takes you to phpMyAdmin, where you need to click the database you have just created. phpMyAdmin will show you the new database with no tables. Click the <em>Import<\/em> tab in the top menu. On the next page click the \u201cchoose file\u201d button and then select the gzipped database file you saved earlier. Finally, click the <em>Go<\/em> button at the bottom of the page. phpMyAdmin will now import your WordPress database.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10360\" src=\"https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/importingdb2.jpg\" alt=\"importingdb2\" width=\"520\" height=\"350\" title=\"\" srcset=\"https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/importingdb2.jpg 520w, https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/importingdb2-300x202.jpg 300w\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" \/><\/p>\n<h2 style=\"text-align: left;\">Step 5: Change the URL<\/h2>\n<p style=\"text-align: left;\">To set up your site online, you need to change its URL. In phpMyAdmin, find the wp_options table in the database we have just imported. If you changed your database prefix, it may be {prefix}_options instead of wp_options.<\/p>\n<p style=\"text-align: left;\">Click the \u201cbrowse\u201d button next to wp_options or the link in the sidebar to open the page listing the fields in the wp_options table.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10361\" src=\"https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/wpoptionsbrowse.jpg\" alt=\"wpoptionsbrowse\" width=\"520\" height=\"231\" title=\"\" srcset=\"https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/wpoptionsbrowse.jpg 520w, https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/wpoptionsbrowse-300x133.jpg 300w\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" \/><\/p>\n<p style=\"text-align: left;\">Under the <strong>options_name<\/strong> field you need to find <strong>siteurl<\/strong>. Click the <em>Edit Field<\/em> icon at the start of the row on the left.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10362\" src=\"https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/editsiteurlphpmyadmin.jpg\" alt=\"editsiteurlphpmyadmin\" width=\"520\" height=\"85\" title=\"\" srcset=\"https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/editsiteurlphpmyadmin.jpg 520w, https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/editsiteurlphpmyadmin-300x49.jpg 300w\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" \/><\/p>\n<p style=\"text-align: left;\">When you click <em>Edit Field<\/em>, a new window appears. In the input field for option_value you will see the URL of your local installation, which will look something like this: http:\/\/localhost\/test. Carefully enter your new URL in this field, for example: https:\/\/coma.lv\/<\/p>\n<p style=\"text-align: left;\">Save the changes by clicking the <em>Go<\/em> button.<\/p>\n<p style=\"text-align: left;\">Next you need to repeat this step for the <strong>home<\/strong> option. Update the <strong>home<\/strong> URL \u2013 it must be identical to your <strong>siteurl<\/strong>.<\/p>\n<h2 style=\"text-align: left;\">Step 6: Configure Your Website<\/h2>\n<p style=\"text-align: left;\">Now that you have imported the database and all of your content is uploaded, it is time to configure WordPress. At this point your site should show a <a href=\"https:\/\/coma.lv\/en\/2024\/08\/21\/error-establishing-a-database-connection-in-wordpress-how-to-fix-it-in-5-minutes\/\">database connection error<\/a>. To fix it, connect to your site with an FTP client and edit the wp-config.php file. Enter the name of the database, the user and the password you created earlier. Save the wp-config.php file and upload it back to your server. Go to your site \u2013 everything should work now.<\/p>\n<p style=\"text-align: left;\">Log in to the WordPress admin panel and choose <strong>Settings &gt; General<\/strong>. Click <em>Save Options<\/em>. This will update the site URL everywhere it is needed.<\/p>\n<p style=\"text-align: left;\">Then go to <strong>Settings &gt; Permalinks<\/strong> and click <em>Save<\/em> to make sure all links work properly.<\/p>\n<h2 style=\"text-align: left;\">Step 7: Update Paths to Fix Broken Links and Images<\/h2>\n<p style=\"text-align: left;\">When you migrate WordPress from one domain to another, or from a local server to a live website, you will run into broken links and images. In that case you can use an SQL query or the <a href=\"https:\/\/wordpress.org\/plugins\/better-search-replace\/\" target=\"_blank\" rel=\"noopener\">Better Search Replace<\/a> plugin for WordPress.<\/p>\n<p style=\"text-align: left;\">If you want to use SQL, here is a simple SQL query that should fix the problem:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nUPDATE wp_posts SET post_content = REPLACE(post_content, &amp;#039;localhost\/test\/&amp;#039;, &amp;#039;www.yourlivesite.com\/&amp;#039;);\r\n<\/pre>\n<p style=\"text-align: left;\">Go to phpMyAdmin, click your database and then SQL in the top menu. Enter this query, but do not forget to insert your own local and live site URLs.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10364\" src=\"https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/wpfiximageurls.jpg\" alt=\"wpfiximageurls\" width=\"520\" height=\"150\" title=\"\" srcset=\"https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/wpfiximageurls.jpg 520w, https:\/\/coma.lv\/wp-content\/uploads\/2016\/09\/wpfiximageurls-300x87.jpg 300w\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" \/><\/p>\n<h2 style=\"text-align: left;\" data-start=\"3953\" data-end=\"3993\">Extra: Security and SEO<\/h2>\n<ul style=\"text-align: left;\">\n<li data-start=\"3997\" data-end=\"4039\">Make sure the site runs on HTTPS.<\/li>\n<li data-start=\"3997\" data-end=\"4039\">Install a security plugin (for example, <a href=\"https:\/\/wordpress.org\/plugins\/wordfence\/\" target=\"_blank\" rel=\"noopener\">Wordfence<\/a> or <a href=\"https:\/\/wordpress.org\/plugins\/better-wp-security\/\" target=\"_blank\" rel=\"noopener\">Solid Security<\/a>).<\/li>\n<li data-start=\"3997\" data-end=\"4039\">Connect the site to Google Search Console and submit a sitemap.<\/li>\n<li data-start=\"3997\" data-end=\"4039\">Remove unneeded test plugins or themes left over from local development.<\/li>\n<\/ul>\n<p style=\"text-align: left;\">That&#8217;s it. We hope your site is now ready to go. Check your site and make sure everything works exactly the way you want. Feel free to leave your comments under this post if you have any difficulties or questions, and we will try to help you.<\/p>\n<p style=\"text-align: left;\">If you move sites regularly, use automated solutions such as WPvivid or All-in-One WP Migration. This will save you a lot of time and keep errors to a minimum.<\/p>\n<hr \/>\n<p style=\"text-align: left;\"><em>Our specialization is WordPress website development and maintenance. Contact us for a free consultation \u2014 <a href=\"mailto:vadim@coma.lv\">vadim@coma.lv<\/a>, <a href=\"tel:+37129394520\">+371 29394520<\/a><\/em><\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>Using a local server can speed up WordPress site development. We have already shown you how to install WordPress on Windows using WAMP and on Mac using MAMP. When you have finished developing on the local server, the next step is to take the site online. In this article we will show you how to [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":38253,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1407,1225],"tags":[],"class_list":["post-41708","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-wordpress"],"_links":{"self":[{"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/posts\/41708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/comments?post=41708"}],"version-history":[{"count":0,"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/posts\/41708\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/media\/38253"}],"wp:attachment":[{"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/media?parent=41708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/categories?post=41708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/tags?post=41708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}