tl:dr Set up your site and Drush locally, commit changes to git, test then use git-ftp to push them to the production server
Here's how I set up things up:
- Set up your site locally. For OS X, I go with MAMP.
- Install Drush and git-ftp on your machine.
- Initialize a git repo in your site directory.
- Set up your .gitignore file (one is included by default in D7). Here are some suggested entries. Make sure settings.php is listed (especially if your site is on Github!), and Drush depending where it's installed.
drush statusto see the current Drush context. If you see a warning about a mysql sock connection, try
sudo mkdir /var/mysqlthen
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock. (HT)
pm-updateto update non-core modules. It will also check your Drupal core version and ask if you want to update that too. After the updates, the command will automatically update your local database.
- Make sure the site works on a local machine (or continue with the steps below with a staging server. Or just go for it if you're brave, it's a low traffic site or because nothing should go wrong if you do.)
- Make any other changes you need to then
git addas needed and
- To be safe, put the production site into maintenance mode and make sure the database is backed up somewhere (most hosts do this automatically or with an add-on, unless you've rolled your own on AWS or similar).
cdinto your local public_html folder and follow the instructions here for your first
git ftp init.
- Configure defaults so you can just use
git ftp pushfrom now on.
- After pushing the changes, check the site status. You might need to run update.php. When everything looks ok, take the site out of maintenance mode.
- Celebrate your freedom from tedium and consider starting new Drupal projects on a host that allows ssh access. Some cPanel-based commodity hosts, like HostGator and Dreamhost, do. Those remain most cost-effective for many commons purposes. For really high traffic or database intensive sites/apps, an integrated solution like Acquia or Pantheon might be worth considering.