Upgrading WordPress

Backup the existing site

  1. Lookup DB credentials: <site-root>/wp-config.php
  2. Backup database: mysqldump --opt --user=<db_username> -p <db_name> > ~/<sitename>/<db_name>.sql
  3. Backup the site: rsync -aP /var/www/sites/<sitename> ~/

Setup new site

  1. Download new version from wordpress.org
  2. Upload to server: rsync -zaP wordpress*.tar.gz <servername>:
  3. Untar the tarball.
  4. Copy the directory into the ~/<sitename>/<sitename>.new folder: cp -a ~/wordpress/ ~/<sitename>/<sitename>.new
  5. Copy the old wp-content directory into the new folder.
  6. Overwrite files in new/wp-content with a new copy from the original download, preserving the existing files from the old site.
  7. Merge changes in old/wp-config.php with new/wp-config-sample.php and put the result into new/wp-config.php
  8. Download updated plugins and put them into new/wp-content/plugins
  9. Download updated themes and put them into new/wp-content/themes