Blocking access during upgrade
I’m fairly confident that I can complete the upgrade to 2.0 without disaster. I am wondering how others have blocked access to their site during an upgrade (to prevent addition of comments while the database is being upgraded, for instance), or if this is even necessary.
The only way I’ve seen is to use a copy of index.php, save it as home.php and remove everything between the content divs, and replace it with something like “Our site is down for maintenance, please check back later”
You’ll need to know a little about “The Loop” to make sure you don’t remove too much, or that you remove enough… but it should work for you without a problem. When you’re done, you can delete the file.
THAT SAID – I’ve never felt the need to take the site down during an upgrade. It happens so fast, and everything like comments and posts are stored in the database (which doesn’t get touched during an upgrade).
Thanks for the response. Lady D. I’ve done a upgrade already on a test copy of my blog on a server I have at home, and the last step is to run upgrade.php. I thought that was doing a database upgrade. Is that belief incorrect?
Is that belief incorrect?
No, it is correct. However it happens in seconds, so I don’t see a reason for all this worry 🙂
The way I upgrade is as follows:
The following assumes the blog is at location other than /wordpress, which I always do, just so I can do this upgrade method. And I use the shell in linux.
- mv blog wordpress
- wget http://wordpress.org/latest.tar.gz
- tar -zxvf latest.tar.gz
- chown -R properuser:properuser wordpress
- mv wordpress blog
Then I poke the upgrade process, in 2.0.3, that’s logging in and clicking the upgrade link.
In English, the above means: change the name of the dir from blog to wordpress, which hides the blog from visitors, but it’s not for long; get the update; unpack it right on top of the old files; set proper owner and group, and do all subfolders etc.; change the name back to blog (or whatever).
Since it’s hidden from users, I don’t need to worry much about them posting comments while I’m replacing files. And then I immediately do the upgrade after changing the dir back to the normal one. It’s never been a problem for me, and I’ve done this at least 40 times, between various blogs and versions.
I never modify wordpress core files, which lets me just write on top of the old files without worry.
That’s a nice method, except… the average WP user is happy if can handle a FTP client from his/her Win machine.
Those who know the shell commands – I bet they are able to upgrade without any further instructions.
For those who are asking here – what you wrote is totally g(r)eek 🙂 For them “shell” is the gas station on the corner!
good point moshu. I wrote thinking there were inbetween types out there.
The main point I wanted to make was that you could rename the directory, making your changes, and change it back. Should be able to that from most ftp clients. But even still, if you’re quick about it, I don’t really see it being a problem. wordpress doesn’t lollygag!
and btw, ftp should be banned from earth 😉 but that’s a whole other thread, and well, other forum too.
manstraw: Thank you for your contribution. I can try this on my test server, to be certain I understand then process, before doing my live blog.
moshu: Not everyone who asks questions here asks because they are a newbie. I’ve understood and used ftp for at least fifteen years. I speak fluent geek (without the ‘r’). At the very least, manstraw’s method is now posted and available for anyone who wants to use it.
You could try this in your
Deny From All
Allow From 126.96.36.199
When 123… is your IP address.
manstraw – if you read the original post, that’s what he was trying to do during his upgrade… remember? so what matt said would work… obviously he’d have to change it back.
(let’s not forget who matt is, okay?) 😉
heh, yeah, i forgot the original point. my bad.
as far as who Matt is, well, I don’t pay much attention to who anyone is. and generally expect the same in return!
Try this? This is quite useful and extremely easy to use 🙂
Thanks for the plugin link, AjAx – didn’t even know about that one. 🙂
manstraw – matt is one of the original creators of wordpress… I’d think one would want to know something like who they’re getting their software from at least! 😉
- The topic ‘Blocking access during upgrade’ is closed to new replies.