Move Wordpress CMS to Another Server With a Different Domain
How to move a Wordpress FTP installation from one server to another that has a different domain
There are two ways to move a Wordpress site between servers, they differ slightly and are based on different requirements.
Moving a Wordpress site to another domain without exporting posts:
This method of moving is for if you are not worried about the original blog functioning or not.
- Backup your SQL Database from the domain we're moving from.
- Copy everything from the FTP server and save it as a backup on your local machine.
- Install Wordpress on the new domain we want to move our site onto (so it's ready for our backed up site).
- On your local machine, edit the "wp-config.php" file and add the SQL database username and password of the fresh installation of Wordpress.
- You can find the SQL Database information by logging onto the Heart Control Panel for that domain and selecting "MySQL Databases", from there you can view the Usernames and Passwords for active MySQL Databases on that domain and manage them accordingly. NOTE: 'DB_NAME' shoud be the same as 'DB_USER', in the "wp-config.php" file.
- Open your backed up SQL Database in your favourite text editor, then run a search & replace for the old domain name, replace for the newer and save your changes (this obviously only applies if the domain name will be changing).
- Compress your SQL Database backup file as a .zip so it will come under the 8MB upload limit that PHPMyAdmin has.
- Log onto the customers control panel once again, select "MySQL Databases" and select 'Manage' for the SQL Database that will soon be used for the moved site. This will load up the 'phpMyAdmin' panel.
- Select your database once you are logged into the phpMyAdmin panel and select "Import".
- Browse to your compressed database and select 'upload' (any options you may leave set to their defaults).
- Once the database has been imported, providing you have not written your URLs incorrectly you should see the posts etc appear on the new site.
- Upload the "wp-content" folder and the "wp-config.php" file to the FTP, replacing their exisiting versions.
- The import will remove whatever existing users there are on your new installation of Wordpress and replace them with the users of the imported site. You will need to edit one of the users passwords via phpMyAdmin to gain access to your new Wordpress installation.
- In the customer control panel, select "Manage" for the Database (located in "MySQL Databases"), select the database name in question and select "wp_users" on the left hand side navigation.
- Click "Edit" on the user you would like to change the password for, look for a Javascript Md5 password generator online and generate an MD5 encrypted password you can use to replace the current password for whatever user you are changing the password for. (Wordpress uses the 'md5 algorithm' to encrypt passwords, so you need to provide a password pre-encrypted for use when editing users via the phpMyAdmin screen.)
- There is a way to create users via the phpMyAdmin screen however when it comes to the permissions it seems to fall over.
- Activate any Plugins or templates that are required if for whatever reason they failed to activate (they should have).
- Give the site a once-over to ensure everything is working.
Method if a login to existing site is available:
This method of moving is best if you need the original blog to be functional.
- On the Wordpress installation we are moving go to Tools > Export. Ensure the drop down's are set to: "All Dates", "All Dates", "All Authors", "All Terms", "All Content" and "All Statuses". Select "Download Export File" and save it to your local machine.
- Copy the "wp-content" folder from the FTP and save it locally on your machine.
- Install Wordpress onto the new domain.
- On the new installation of Wordpress go to Tools > Import, select "Wordpress" and install the plugin if required. Repeat this step once the plugin has been installed however this time you will be able to import your XML file into the new installation of Wordpress.
- Upload your previously downloaded "wp-content" folder to the new Wordpress FTP installation, replacing any existing version of it.
- Activate any plugins / Themes that failed to activate during the move.
- Give the site a once-over to ensure everything is working.