Because of some sudden need I had to check how a wordpress website can be locally maintained. One simple way of maintaining a website and deploying it to live site is below.

  1. What you need is a local database server and a Webserver. One of the available options which comes as an integrated package is MAMP(Macintosh, Apache, MySQL, PHP). LAMP/WAMP/XAMPP does the same thing for Windows.
  2. Install MAMP. The default folder for hosting is htdocs. This can be modified through Preferences > Apache.
  3. Start MAMP Server. The default site will be http://localhost:8888/MAMP/.
  4. Extract the WordPress installation into htdocs folder.
  5. Open phpMyAdmin from http://localhost:8888/MAMP/
  6. Open the tab Databases
  7. Create a new database and name it as wordpress
  8. Rename the file wp-config-sample.php as wp-config.php in the folder htdocs>wordpress
  9. Modify the below lines in the file.

/** The name of the database for WordPress */
define(‘DB_NAME’, ‘database_name_here’);

/** MySQL database username */
define(‘DB_USER’, ‘username_here’);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘password_here’);

/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);

database_name_here will be wordpress as what is set.

If DB_USER and DB_PASSWORD are not modified, they will be set to root/root.

10. Configure the wordpress installation through the path http://localhost:8888/wordpress/

A plugin, duplicator is an easy way to migrate the website. What you need to do is to install the plugin, download a copy of the website and move it to the live location. Use the same plugin to deploy the local site.

A few good references –