Quicker WordPress upgrades?
March 14, 2006 8:02 PM   Subscribe

I'm trying to keep up with WordPress upgrades (2.0.2 just came out yesterday, and I was only halfway through upgrading 30 installs to 2.0.1!), but I swear there must be an easier way than the way I'm doing it.

I run multiple installs of WordPress. I run them in renamed directories (domain.com/bob), rather than keeping the default (domain.com/wordpress). When a new version comes out, here's what I do at the command line:

1. Rename the directory ('bob' to 'bob.old').

2. Unpack the new version (tar -xvzf wordpress-x-x-x.tar.gz), which automatically puts itself in a directory called 'wordpress'.

3. Rename 'wordpress' to 'bob'.

4. Copy the wp-config.php, .htaccess, plugins, and assorted theme files from 'bob.old' to 'bob.'

Step four is a pain, and I frequently miss things I should have copied over, so I keep looking at step 2 and thinking there must be an easier way. The documentation says to just install the new files over the old files (and the installer uses filenames like wp-config-sample.php to make sure it doesn't overwrite your actual config file), but apart from FTP, how do I do that with the tar command? In other words, how can I tell tar to unpack the contents of the file into the pre-existing 'bob' rather than into a 'wordpress' directory?

I know there are other WordPress gurus here, and I'm hoping I'm just missing something so blatantly obvious it'll hurt to read the answer.
posted by pzarquon to Computers & Internet (10 answers total)
 
I'm not familiar with the multiple install thing, but can you just run update.php? If you have more than one install (i.e., more than one "bob"), shouldn't they all have their own install.php?
posted by danb at 8:31 PM on March 14, 2006


update.php, rather.
posted by danb at 8:31 PM on March 14, 2006



I had to do this (once) last night.

1. Copy /bob/ to /bob_backup/
2. Unpack latest.tar.gz to /wordpress/
3. copy [overwrite = yes] [recursive = yes] /wordpress/* to /bob/
4. In browser visit /bob/wp-admin/update.php
posted by ajbattrick at 4:25 AM on March 15, 2006


If you have 30 WP installs on your server you might want to look into WordPress Multiuser, so that you have a single point of upgrade.
posted by revgeorge at 6:59 AM on March 15, 2006


I just unpack the new version on top of the old, then run /wp-admin/update.php. Takes me about five minutes to update four installs.
posted by mrbill at 10:16 AM on March 15, 2006


I think this will work:
  1. ln -s bob wordpress
  2. tar xzf wordpress-x-x-x.tar.gz
  3. rm wordpress

posted by mbrubeck at 11:49 AM on March 15, 2006




If you're using GNU tar you can just use --strip-components=1 to remove the leading "wordpress/" path from files extracted, e.g. from the root "tar -C bob --strip-components=1 zxvf path/to/file.tar.gz" No symlinking or moving files around necessary.
posted by Rhomboid at 3:15 PM on March 15, 2006


Thanks for the thoughts. I know I should "unpack the new version on top of the old," but I was just struggling with the fact that the WordPress install file automatically goes into a directory called 'wordpress,' not the subdirectory I want it to go into.

Say, ajbattrick, I was thinking there was a way with simple commands. What is the command and the switches for your step three there? Copy over, basically?

I see mbrubeck's solution has fewer steps. So you're linking (ln) 'bob' to a 'wordpress' directory, doing the install (which I guess goes to both), then deleting the wordpress directory? Could I conceivably link several directories to 'wordpress,' and have the tar xzf install reproduced across them all?
posted by pzarquon at 3:37 PM on March 15, 2006


You would need to do it once for each installation, sorry.
posted by mbrubeck at 8:06 PM on March 15, 2006


« Older Tulum, Mexico Travel Advice Needed   |   Feedback from my amplifier's phono setting? Newer »
This thread is closed to new comments.