I'm not sure how many of you know of this, or even have it on your server to use, as some hosts I believe don't allow it, but if you have a link on your control panel on the server your site is on, there's a very easy way to upload and install the newest release of
PostNuke.
I'd like to go thru the whole thing with you here from start to finish as I believe that once you read this, you may just find yourself with a lot less time wasted, less files possibly being corrupted in transfer, and your site being down for as minimal of time as possible, which is a good thing.
You already know how to upload files and get
PostNuke working I'm sure, this little explanation will cover two things.
Working via an SSH session
Upgrading your sites files and directories.
Using SSH;
OK, so you see that you have SSH on your server and want to try using it, well once you try it once you'll wonder why you haven't always used it. Those that do? Know what I mean.
First, let's create a directory on your server called temptar. You can name it whatever you want, but a name like this will be easy to remember.
Second, upload
PostNuke-phoenix-0.7.2.3.tar.gz to this new directory.
Uploading on my DSL line takes about 2 minutes.
By the way, you can rename this to whatever you want to as well. I'll rename this file to pn.tar.gz for this tutorial.
Third, click the link in your hosts admin panel that says SSH to start, and up will come a terminal window (pop-up) like this;
http://mswebdesign.com/fun/firstview.gif
Once you are in, first thing to do is hit enter key, you'll get a login: prompt, type in your username there and hit enter again. You'll get a confirmation message saying
"Host was not found in preinstalled known_hosts file,continue anyway?" Click yes.
*you may see a message that says "File operations disabled, server can't be verified"
Right under that, it asks for your password, type in in and hit enter once again.
You are now logged in and ready to go to work.
Type in cd public_html and hit enter it will seem like nothing happened. But you just changed directories.
By typing in ls, you'll get a list of all files and directories in public_html.
Your in public_html right now, we need to get to temptars, that's the directory we made earlier and uploaded the tar file to? OK, so type this cd temptars and hit enter. You'll know your in the right place by typing in ls again. It will show you what's in there, which right now is only the pn.tar.gz tarball.
We need to get this unpacked now that we've navigated to it. So type in this command;
tar -zxvf pn.tar.gz and hit enter, this will unpack the file, it will list everything it unpacks for you. Easy huh?
Now, go to your FTP client, and look inside the temptars directory, you'll see a new directory named
PostNuke-phoenix-0.7.2.3 in there. {remember, we renamed the tarball, but this
PostNuke-phoenix-0.7.2.3 directory is inside of it)
http://mswebdesign.com/fun/ftpview_after_unpack.gif
That's it! You've just unpacked your first tarball. 2 minutes to upload it, give or take another 2-3 minutes depending on you typing in the commands properly to unpack it, and your done. Let's move on to upgrading your site now.
Upgrading PostNuke itself;
Some people suggest you simply overwrite files during an upgrade, I don't go by this method, as I'd like to keep my site intact in case of a problem, I can revert back to the installation that was working fine.
So although I am sure there are other ways to do this, here's my tried and true way to do it that works for me.
First, backup your
SQL database for the site. You may have an option for this in your hosts control panel as I do, or you may need to have
phpMyAdmin installed which will work great as well. Here's how you would go about it with
phpMyAdmin Ver. 2.3.2
Open your browser to the welcome page of
phpMyAdmin and look to your left, you'll see your database(s) listed there in a dropdown menu. Click the appropriate
DB. Once you do that, on the window to the right, you'll see some "buttons" across the top, click Export. On the page that opens, you'll see a window with all tables listed, and some options to pick from. Since we're doing a backup right now, we'll only deal with that.
Click the "select all" link which highlites all tables inside that box, then click the radiobutton for "Structure and data" and click the other radiobutton that says "Save as file" and then Hit Go!
http://mswebdesign.com/fun/sqldump.gif
You've just backed up your entire database in less than 2 minutes.
Second, go to your pnSite's admin panel, and set the default theme to
PostNuke, this should help prevent any problems you might encounter with a custom theme not working correctly after the upgrade.
Third, We need to move out your old site to make way for the new one, this is easier than it sounds.
If all you have in the directory that contains your
PostNuke site is the site itself, this will be very easy, if you've got other files and directories in there, you'll need to pay close attention as you prepare to move them all.
We'll need the config.php file during the upgrade process, so download it to your computer locally for right now.
In your root directory, (same place we made the temptars directory earlier?) make another one called something you'll remember like backup_site or whatever suits you.Navigate back to where the sites files and folders are all located and let's get ready to move them all out.
If you unpacked the tarball locally, you'll see the files and directories in the
HTML folder that you need to know the names of in order to move then all at once. On your server, via your FTP client, you want to click them all once by one, holding the control key so that you can highlite multiple files and folders at once. Click each and every file and directory associated with
PostNuke making sure they all stay highlighted, and then right click any of them and choose move, or copy depending on your client of course.
Once you've done this, navigate to the new directory we made earlier called "backup_site". In there, you right click again and choose paste. Shouldn't take but a few seconds to move it all over there. You've just removed your entire site, it will no longer work at this point.
Navigate back to the "/temptars/postnuke-phoenix-0.7.2.3/html/" directory we unpacked to earlier and do again what you just did. Highlite ALL files inside the "
HTML" directory, and choose copy, or move. Navigate back to where your site was located and choose paste. That's it.
Remember the file we downloaded earlier called config.php? Rename that file now to pn7config.php and re-upload it into the same directory where the new files are. Right click config.php file on your server and choose chmod, set the value to 666 also do the same with config-old.php. Now let's run the upgrade script, point your browser to www.yoursite/install.php
and your on your way.
You'll need to know the database username, the database name, and the database password to upgrade. so have these ready.
Choose upgrade to the latest version listed, do not check the box create
DB since we already have one, and your site should be upgraded with a few clicks of the mouse.
At the end of the install, you'll want to go back and re set chmod on the two files mentioned earlier to 644 and you'll want to delete the install.php and install directory itself.
Now, your site's back up, seems to be working, but your missing your custom images and a few other things like certain
3rd party blocks and modules, themes and so on.
We need to navigate back to the "backup_site" directory and go to the images directory inside it and highlite all images, navigate back to your new installs images directory and choose paste. All images now will work as before.
Go to your "old" modules directory, highlite the modules you know that you've added such as a forums module for one example, go back to the "new" modules directory and paste it in there. You'll need to look in the "/backup_site/includes/blocks" directory as well for other things you may have added before, and move files back over from there too.
Once you do this for all of the modules you had previously installed, you'll want to go to the modules section of the admin page and re generate the list there. Any modules listed that say "remove" because files are missing, don't click remove, unless you want to, this is another way of seeing what still needs "moved back in" from your old install.
Well, that's it. Not too tough and if you were to time this procedure from start to finish, it should really take less than 20 minutes tops.
The ideal situation being, all files all still on your server, you've only uploaded one tarball back at the beginning of this, and the config.php. The rest are already there, you just need to go thru and move back in what's missing from the new installation. I suggest you leave the "backup_site" directory there until you are SURE you don't need it, and even then a backup of it locally before you delete it to save space on your server, is a wise idea.
Hopefully, this will take some of the worry out of upgrading for you, and that you'll see it's not only easy to do, but actually kinda fun, and can be done on most sites very quickly. :)
I'll update this or make any corrections to things I may have left out as needed.
--
Friends rock, bullshit walks