Three weeks ago: The First Steps to Building Your Website in WordPress

Two weeks ago: Installing WordPress on a Web Server

Last week: Installing WordPress on a Local Server (MAMP)

This week: Moving a Locally Installed WordPress (MAMP) on a Live Server

In the last tutorial of the WordPress series, I’ll explain the process of moving your locally installed (using MAMP) WordPress website on a live server. Alternatively, you could apply the same rules to moving the website on a new server.

1. Acquire a domain name. In the settings panel of the domain provider, point the domain to your hosting company’s Nameservers

In case you have purchased your hosting service together with domain, you can skip this step.

2. Export a copy of your locally installed WordPress site’s database as an SQL file

To do this, click the phpMyAdmin button on the MAMP’s startpage. Click on the site’s database on the left – now you should see all of the tables of your WordPress installation as on the picture below:

Ensure all the tables are selected. Additionally, make sure all the spaces are checked as on the image below, including “Save as file” at the bottom. Click “Go” – now a copy of your database should be on your computer.

3. Open the exported database in a text editor such as TextEdit, do a mass search and replace the local URL with the new server’s URL

Typically, a MAMP-installed site’s address would look something like “http://localhost:8888/yourwebsite”. In the text editor you would need to change this to “http://www.yourwebsite.com” wherever it appears.

4.  Make a copy of your locally installed website’s files accessible at Applications > MAMP > htdocs > yourwebsite

If you’re moving the website from a web server to another, copy the website’s files with your favourite FTP client or your host’s Cpanel onto your computer’s hard drive.

5. In your new web host’s Cpanel, create a new MySQL database

In case you don’t have a MySQL user yet, you’ll need to create one and remember the user’s name and password. Add the database to the user, click “All Privileges”, then “Make changes”.

6. Edit config wp-config-sample.php with your new database details and save it as wp-config.php

Enter ‘localhost’ as your MySQL hostname unless stated otherwise by your web host.

7. Make your uploads directory writeable (permissions 777) …/wp-content/uploads

You can to this either with your favourite FTP client or the file manager of your host’s Cpanel (by right mouse clicking the Uploads folder and selecting Info > Change Permissions)

8. Import the tables of the local database to the new database in your host’s Cpanel (phpMyAdmin)

9. Log in to http://www.yourwebsite.com/wp-admin

10. If necessary, update the Images linked to posts/pages URLs

11. Login into the WP admin of the new site and go to Settings > Permalinks and click “Save Changes” so an .htaccess file with permalink structure is created on the new server.

If you’d like to read more on moving WordPress or solve any issues you’ve encountered during the process, I’d strongly recommend you read Jason Bobich’s excellent guide or WordPress Codex on moving WordPress.

2 Comments

  • Thanks. Very helpful tutorial. I have been messing with WP for years but this is the first time I used MAMP, and this tutorial is just what I needed. Thanks again.

Leave a Reply