{"id":544,"date":"2021-07-23T12:32:34","date_gmt":"2021-07-23T12:32:34","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/how-to-migrate-a-wordpress-installation-to-a-cpanel-whm-server\/"},"modified":"2021-07-23T12:32:34","modified_gmt":"2021-07-23T12:32:34","slug":"how-to-migrate-a-wordpress-installation-to-a-cpanel-whm-server","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/how-to-migrate-a-wordpress-installation-to-a-cpanel-whm-server\/","title":{"rendered":"How to Migrate a WordPress\u00ae Installation to a cPanel &#038; WHM Server"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\"><\/div>\n<hr>\n<h2 id=\"overview\">Overview<\/h2>\n<p>This tutorial explains how to migrate a macOS\u00ae server-hosted WordPress\u00ae installation to a cPanel &#038; WHM server. This is useful, for example, If you develop your website on a locally-hosted server and wish to deploy your work to a public-facing server.<\/p>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<ul>\n<li>Your website will likely experience downtime during this process.<\/li>\n<li>Because cPanel, L.L.C. doesn\u2019t develop WordPress itself, cPanel Technical Support can\u2019t help you perform the migration.<\/li>\n<\/ul><\/div>\n<\/div>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n<p>As of Fall 2018, Apple\u00ae will <strong>no longer<\/strong> support website hosting on macOS servers. For more information, read Apple Support\u2019s Prepare for changes to macOS Server documentation.<\/p>\n<\/p><\/div>\n<\/div>\n<h2 id=\"migrate-your-wordpress-installation\">Migrate your WordPress installation<\/h2>\n<h3 id=\"pre-migration-requirements\">Pre-migration requirements<\/h3>\n<p>Before you begin, make <strong>certain<\/strong> that you possess the following:<\/p>\n<ul>\n<li>A domain that exists on a cPanel &#038; WHM server.<\/li>\n<li>A File Transfer Protocol (FTP) client and account.<\/li>\n<\/ul>\n<h3 id=\"export-the-wordpress-database\">Export the WordPress database<\/h3>\n<p>Export your WordPress installation\u2019s database with the phpMyAdmin tool. To do this, perform the following steps:<\/p>\n<ol>\n<li>\n<p>Navigate to <code>localexample.com\/phpmyadmin<\/code>, where localexample represents your locally-hosted domain. The phpMyAdmin interface will appear.<\/p>\n<\/li>\n<li>\n<p>Click <em>Export<\/em> in the toolbar. A new interface will appear.<\/p>\n<\/li>\n<li>\n<p>Under the <em>Export Methods:<\/em> heading, select either of the following export methods:<\/p>\n<ul>\n<li><em>Quick<\/em> \u2014 This method displays the minimum settings.<\/li>\n<li><em>Custom<\/em> \u2014 This method displays all possible settings.\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n        We recommend that you select Quick.\n    <\/div>\n<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Select the database\u2019s format from the <em>Format:<\/em> menu. This setting defaults to <em>SQL<\/em>.<\/p>\n<\/li>\n<li>\n<p>Click <em>Go<\/em>. The system will create a download file that contains your database information.<\/p>\n<\/li>\n<\/ol>\n<h3 id=\"upload-the-files-to-the-new-server\">Upload the files to the new server<\/h3>\n<p>Connect to your web hosting account via your preferred FTP client and upload your WordPress files to your web host account\u2019s <code>public_html<\/code> directory.<\/p>\n<h3 id=\"create-a-mysql-database\">Create a MySQL database<\/h3>\n<p>Create a MySQL\u00ae database to which to import the WordPress database in cPanel\u2019s <em>MySQL Databases<\/em> interface (<em>cPanel &gt;&gt; Home &gt;&gt; Databases &gt;&gt; MySQL\u00ae Databases<\/em>).<\/p>\n<h3 id=\"import-the-wordpress-database-to-cpanel\">Import the Wordpress database to cPanel<\/h3>\n<p>Import your WordPress database backup file to cPanel &#038; WHM. To do this, perform the following steps:<\/p>\n<ol>\n<li>Navigate to cPanel\u2019s <em>phpMyAdmin<\/em> interface (<em>cPanel &gt;&gt; Home &gt;&gt; Databases &gt;&gt; phpMyAdmin<\/em>).<\/li>\n<li>Click <em>Databases<\/em> in the toolbar and then click the database that you created in the previous step.<\/li>\n<li>Click <em>Import<\/em> in the toolbar. A new interface will appear.<\/li>\n<li>Click <em>Choose File<\/em> and select the database backup file that you created in Step 1.<\/li>\n<li>Click <em>Go<\/em>. The system will import your WordPress database.<\/li>\n<\/ol>\n<h3 id=\"change-the-website-url\">Change the website URL<\/h3>\n<p>You <strong>must<\/strong> change the website URL in your database so that the database connects with your WordPress site. To do this, perform the following steps in cPanel\u2019s <em>phpMyAdmin<\/em> interface (<em>cPanel &gt;&gt; Home &gt;&gt; Databases &gt;&gt; phpMyAdmin<\/em>):<\/p>\n<ol>\n<li>Locate the <em>wp_options<\/em> table and click <em>Browse<\/em>.<\/li>\n<li>Under the <em>option_name<\/em> column, locate the <em>siteurl<\/em> entry and click <em>Edit<\/em>.<\/li>\n<li>In the <em>option_value<\/em> column, enter your website\u2019s new URL in the text box and click <em>Go<\/em>.<\/li>\n<li>Locate the home entry and click <em>Edit<\/em>.<\/li>\n<li>In the <em>setting_value<\/em> column, enter your website\u2019s new URL in the text box and click <em>Go<\/em>.<\/li>\n<\/ol>\n<h3 id=\"configure-the-wordpress-database-settings\">Configure the WordPress database settings<\/h3>\n<p>You <strong>must<\/strong> configure your WordPress database settings to use the information for the database that you created in step 3. To do this, perform the following steps:<\/p>\n<ol>\n<li>\n<p>Navigate to cPanel\u2019s <em>File Manager<\/em> interface (<em>cPanel &gt;&gt; Home &gt;&gt; Files &gt;&gt; File Manager<\/em>).<\/p>\n<\/li>\n<li>\n<p>Open the <code>public_html<\/code> directory and locate the <code>wp-config.php<\/code> file.<\/p>\n<\/li>\n<li>\n<p>Right-click the <code>wp-config.php<\/code> file and click <em>Edit<\/em>. A pop-up window will appear.<\/p>\n<\/li>\n<li>\n<p>Click <em>Edit<\/em> in the pop-up window. The editor will appear in a new browser tab.<\/p>\n<\/li>\n<li>\n<p>Edit the <code>DB_NAME<\/code>, <code>DB_USER<\/code>, and <code>DB_PASSWORD<\/code> lines to match the information for the database that you created in step 3. This will resemble the following example: <\/p>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 3\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 4\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 5\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 6\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 7\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 8\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 9\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">10\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">11\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">12\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\">  <span style=\"color:#75715e\">\/\/ ** MySQL settings ** \/\/\n<\/span><span style=\"color:#75715e\"><\/span>  <span style=\"color:#75715e\">\/** The name of the database for WordPress *\/<\/span>\n  <span style=\"color:#a6e22e\">define<\/span>( <span style=\"color:#960050;background-color:#1e0010\">'<\/span><span style=\"color:#a6e22e\">DB_NAME<\/span><span style=\"color:#960050;background-color:#1e0010\">'<\/span>, <span style=\"color:#960050;background-color:#1e0010\">'<\/span><span style=\"color:#a6e22e\">mrfrogor_wp<\/span><span style=\"color:#960050;background-color:#1e0010\">'<\/span> );\n\n  <span style=\"color:#75715e\">\/** MySQL database username *\/<\/span>\n  <span style=\"color:#a6e22e\">define<\/span>( <span style=\"color:#960050;background-color:#1e0010\">'<\/span><span style=\"color:#a6e22e\">DB_USER<\/span><span style=\"color:#960050;background-color:#1e0010\">'<\/span>, <span style=\"color:#960050;background-color:#1e0010\">'<\/span><span style=\"color:#a6e22e\">mrfrogor_wp<\/span><span style=\"color:#960050;background-color:#1e0010\">'<\/span> );\n\n  <span style=\"color:#75715e\">\/** MySQL database password *\/<\/span>\n  <span style=\"color:#a6e22e\">define<\/span>( <span style=\"color:#960050;background-color:#1e0010\">'<\/span><span style=\"color:#a6e22e\">DB_PASSWORD<\/span><span style=\"color:#960050;background-color:#1e0010\">'<\/span>, <span style=\"color:#960050;background-color:#1e0010\">'<\/span><span style=\"color:#a6e22e\">zQWDu1CdqbVx<\/span><span style=\"color:#960050;background-color:#1e0010\">'<\/span> );\n\n  <span style=\"color:#75715e\">\/** MySQL hostname *\/<\/span>\n  <span style=\"color:#a6e22e\">define<\/span>( <span style=\"color:#960050;background-color:#1e0010\">'<\/span><span style=\"color:#a6e22e\">DB_HOST<\/span><span style=\"color:#960050;background-color:#1e0010\">'<\/span>, <span style=\"color:#960050;background-color:#1e0010\">'<\/span><span style=\"color:#a6e22e\">localhost<\/span><span style=\"color:#960050;background-color:#1e0010\">'<\/span> );<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p>After make your changes, click <em>Save Changes<\/em><\/p>\n<\/li>\n<\/ol>\n<h3 id=\"update-links-and-images\">Update links and images<\/h3>\n<p>Your website may contain broken links and broken images after you migrate your website. To update the links and images to use your new website\u2019s URL, perform the following steps:<\/p>\n<ol>\n<li>\n<p>Navigate to cPanel\u2019s <em>phpMyAdmin<\/em> interface (<em>cPanel &gt;&gt; Home &gt;&gt; Databases &gt;&gt; phpMyAdmin<\/em>).<\/p>\n<\/li>\n<li>\n<p>Click <em>Databases<\/em> in the toolbar and then click the database that you created in step 3.<\/p>\n<\/li>\n<li>\n<p>Click <em>SQL<\/em> in the toolbar.<\/p>\n<\/li>\n<li>\n<p>In the text box, enter an SQL query to update your URLs. For example:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-perl\" data-lang=\"perl\">UPDATE wp_posts SET post_content <span style=\"color:#f92672\">=<\/span> REPLACE(post_content, <span style=\"color:#e6db74\">'localexample.com\/, www.mrfrog.com\/'<\/span>)<\/code><\/pre>\n<\/div>\n<\/li>\n<li>\n<p>Click <em>Go<\/em> to run the query.<\/p>\n<\/li>\n<\/ol>\n<h3 id=\"save-the-changes-in-wordpress-interface\">Save the changes in WordPress interface<\/h3>\n<p>After you updates your links and images, save the changes in the WordPress dashboard to update the URL. To do this, perform the following steps:<\/p>\n<ol>\n<li>\n<p>Log in to the WordPress dashboard.<\/p>\n<\/li>\n<li>\n<p>Navigate to the <em>General<\/em> interface (<em>Main &gt;&gt; Settings &gt;&gt; General<\/em>).<\/p>\n<\/li>\n<li>\n<p>Click <em>Save<\/em> at the bottom of the interface.<\/p>\n<\/li>\n<li>\n<p>Navigate to the <em>Permalink<\/em> interface (<em>Main &gt;&gt; Settings &gt;&gt; Permalink<\/em>).<\/p>\n<\/li>\n<li>\n<p>Click <em>Save<\/em> at the bottom of the interface.<\/p>\n<\/li>\n<\/ol>\n<h3 id=\"delete-your-macos-website\">Delete your macOS website<\/h3>\n<p>After you complete your website\u2019s migration to a cPanel &#038; WHM server, delete the website that remains on your macOS server.<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overview This tutorial explains how to migrate a macOS\u00ae server-hosted WordPress\u00ae installation to a cPanel &#038; WHM server. This is useful, for example, If you develop your website on a locally-hosted server and wish to deploy your work to a public-facing server. Warning: Your website will likely experience downtime during this process. Because cPanel, L.L.C. &hellip;<\/p>\n","protected":false},"author":1,"featured_media":545,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/544"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=544"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/544\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/545"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}