{"id":855,"date":"2012-02-17T15:06:06","date_gmt":"2012-02-17T14:06:06","guid":{"rendered":"http:\/\/www.nethosted.co.uk\/blog\/?p=855"},"modified":"2023-07-14T08:15:18","modified_gmt":"2023-07-14T07:15:18","slug":"how-to-migrate-a-cms-to-a-new-server-or-domain","status":"publish","type":"post","link":"https:\/\/www.nethosted.co.uk\/blog\/uk-web-hosting\/how-to-migrate-a-cms-to-a-new-server-or-domain","title":{"rendered":"How to migrate a CMS to a new server or domain"},"content":{"rendered":"<p>If you are looking to move your site to a new hosting company, perhaps to change the URL of your website or setup a copy of the site for testing and development purposes this guide will give a general overview of how to go about this. The steps tend to be fairly similar for any content management system so this will point you in the right direction, though for specific tips we&#8217;d recommend checking out the documentation and community sites for the CMS you are using.<\/p>\n<h3>&nbsp;Step 1 &#8211; Backup!<\/h3>\n<p>The importance of creating a backup of your site before making changes to it can never be overstated, using cPanel this can be done with just a couple of clicks and could save you hours if not days of work down the line. This process shouldn&#8217;t affect your existing site however mistakes can happen so it&#8217;s always best to be on the safe side.<!--more--><\/p>\n<h3>&nbsp;Step 2 &#8211; Export database via phpMyAdmin<\/h3>\n<p>Select phpMyAdmin in cPanel and click the name of the database you wish to export on the left, then click the Export tab. The default options are fine so you can just leave quick selected, then press the Go button which will download the database .sql file, make a note of where this downloads to on your computer.<\/p>\n<p><img decoding=\"async\" title=\"export-cms\" src=\"https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/export-cms.jpg\" alt=\"\"><\/p>\n<div style=\"clear: both;\"><\/div>\n<h3>Step 3 &#8211; Download website files<\/h3>\n<p>Login to your old site via FTP and download all files inside the public_html\/ folder (assuming this is the main domain on the account, if it is an addon domain then you should download all files within the addon domain folder which is a subfolder of your public_html). You will need to upload these to the new site via FTP shortly.<\/p>\n<h3>Step 4 &#8211; Upload website files<\/h3>\n<p>You should now login to the new site FTP, and upload the files previously downloaded. If this is the main domain on a new account then these can go straight into the public_html\/ folder, if it is an addon domain then you should put them inside the addon domain folder that you have specified in the cPanel Addon Domains section.<\/p>\n<h3>Step 5 &#8211; Create a new database<\/h3>\n<p>In the MySQL Databases section of cPanel you now need to create a new database<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-861 alignnone\" title=\"createdb\" src=\"https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/createdb.jpg\" alt=\"\" width=\"500\" height=\"266\" srcset=\"https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/createdb.jpg 500w, https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/createdb-300x159.jpg 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<div style=\"clear: both;\"><\/div>\n<p>Then create a new user, making a note of the password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-862 alignnone\" title=\"createuser\" src=\"https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/createuser.jpg\" alt=\"\" width=\"500\" height=\"256\" srcset=\"https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/createuser.jpg 500w, https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/createuser-300x153.jpg 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<div style=\"clear: both;\"><\/div>\n<p>Now add that user to the new database<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-863 alignnone\" title=\"adduser\" src=\"https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/adduser.jpg\" alt=\"\" width=\"356\" height=\"130\" srcset=\"https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/adduser.jpg 356w, https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/adduser-300x109.jpg 300w\" sizes=\"(max-width: 356px) 100vw, 356px\" \/><\/p>\n<div style=\"clear: both;\"><\/div>\n<h3>Step 6 &#8211;&nbsp; Import database via phpMyAdmin<\/h3>\n<p>Go to phpMyAdmin in your new account and select the new database you just created on the left. Now click the import button, then choose file and select the earlier database backup that we made, then click Go.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-864\" title=\"importdb\" src=\"https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/importdb.jpg\" alt=\"\" width=\"904\" height=\"812\" srcset=\"https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/importdb.jpg 904w, https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/importdb-300x269.jpg 300w, https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/importdb-590x529.jpg 590w\" sizes=\"(max-width: 904px) 100vw, 904px\" \/><\/p>\n<div style=\"clear: both;\"><\/div>\n<h3>Step 7 &#8211; Edit configuration file with new database settings<\/h3>\n<p>The location of this file will vary depending on what CMS you are using, but the process should be the same for all CMS. You will need to locate the configuration file and edit this, changing the database name, database username and database user password, all of which you have previously created. The database name and database username will begin with your cPanel username followed by an underscore.<\/p>\n<p><strong>Common CMS configuration file locations (relative from installation directory):<\/strong><\/p>\n<p><a href=\"https:\/\/www.nethosted.co.uk\/uk-drupal-hosting.php\" target=\"_blank\" rel=\"noopener\">Drupal<\/a> &#8211; sites\/default\/settings.php<\/p>\n<p><a href=\"https:\/\/www.nethosted.co.uk\/uk-wordpress-hosting.php\" target=\"_blank\" rel=\"noopener\">WordPress<\/a> &#8211; wp-config.php<\/p>\n<p><a href=\"https:\/\/www.nethosted.co.uk\/uk-joomla-hosting.php\" target=\"_blank\" rel=\"noopener\">Joomla<\/a> &#8211; configuration.php<\/p>\n<p><a href=\"https:\/\/www.nethosted.co.uk\/uk-magento-hosting.php\" target=\"_blank\" rel=\"noopener\">Magento<\/a> &#8211; app\/etc\/local.xml<\/p>\n<p><a href=\"https:\/\/www.nethosted.co.uk\/uk-concrete5-hosting.php\" target=\"_blank\" rel=\"noopener\">Concrete5<\/a> &#8211; config\/site.php<\/p>\n<h3>Step 8 &#8211; Edit the site URL in the database (URL changes only)<\/h3>\n<p>This step may not always be necessary, some CMS&#8217;s hardcode the site URL into the database when they are setup, if this is the case then when you visit the new site some links or the whole site may end up redirecting to the old URL. You should then go back into phpMyAdmin and select the new database, select the search tab and enter the domain surrounded by % signs, e.g. %domain.com% &#8211; You should edit any instances that show up in configuration tables to the new URL.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-868\" title=\"searchdb\" src=\"https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/searchdb.jpg\" alt=\"\" width=\"866\" height=\"554\" srcset=\"https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/searchdb.jpg 866w, https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/searchdb-300x191.jpg 300w, https:\/\/www.nethosted.co.uk\/blog\/wp-content\/uploads\/2012\/02\/searchdb-590x377.jpg 590w\" sizes=\"(max-width: 866px) 100vw, 866px\" \/><\/p>\n<div style=\"clear: both;\"><\/div>\n<h3>Step 9 &#8211; Finished!<\/h3>\n<p>Admire your work as you&#8217;ve just migrated your CMS successfully (with a bit of luck!)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are looking to move your site to a new hosting company, perhaps to change the URL of your website or setup a copy of the site for testing and development purposes this guide will give a general overview of how to go about this. The steps tend to be fairly similar for any [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[138,8],"tags":[],"aioseo_notices":[],"views":5203,"_links":{"self":[{"href":"https:\/\/www.nethosted.co.uk\/blog\/wp-json\/wp\/v2\/posts\/855"}],"collection":[{"href":"https:\/\/www.nethosted.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nethosted.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nethosted.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nethosted.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=855"}],"version-history":[{"count":27,"href":"https:\/\/www.nethosted.co.uk\/blog\/wp-json\/wp\/v2\/posts\/855\/revisions"}],"predecessor-version":[{"id":1996,"href":"https:\/\/www.nethosted.co.uk\/blog\/wp-json\/wp\/v2\/posts\/855\/revisions\/1996"}],"wp:attachment":[{"href":"https:\/\/www.nethosted.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nethosted.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nethosted.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}