Contributed by SrNupsen

Introduction

If you're like me, you like to develop your web pages in quiet surroundings, with nobody hanging over your shoulder yelling "Oh, that <div> is REALLY out of line!" or even "I can't login to Coranto!!" ("I haven't installed it yet, so shut up!").

Well anyway, you would want to install Coranto, set everything up, and then copy the whole site over to to it's new and more publicly available home. But there are a number of pitfalls. This is an attempt to list the possible things that might go wrong, but there are surely things I have forgotten about. If you spot anything or have any experiences to share, please leave a note in the forums over at the Official Site.

MAKE A BACKUP

Yes, it's a rather dull advice for most of you. Ofcourse you backup your data regularly. Or don't you? OK then, proceed at your own risk. Hopefully you have the spare time on your hands to recreate your site from scratch if something goes terribly wrong.

Transfer the files

The most practical thing to do is to stuff everything into a .zip file, download it to your computer, upload it to the new site and unpack it there. I'm using Unix servers, so all the examples will be Unix-specific. I'm quite sure you can do exactly the same things on a Windows server, but the syntax will be slightly different and you will have to look it up yourself.

Zip it!

cd to your www root directory (public_html/, www/ or whatever). Then use the 'zip -ry mysite.zip *' command to create the zip file. Note the -r flag to recurse into subdirectories and the -y flag to treat symbolic links as... symbolic links. The -y flag is IMPORTANT if you use symbolic links on your site (for includes etc.), as if you don't specify it then the zip program will pack one instance of each file into the zip file every time it is linked to. Later, when you unzip your site, you will end up with a lot of independent files and/or directories with no link between them and you will have to a) delete all but the master and b) recreate all of your symbolic links. I've been through this, and trust me, it's not the way you want to spend your Monday evening. If you need other exotic options for your zip file, just type 'zip' with no arguments to get a brief command overview.-<

Download/upload it!

I'll leave to you how to download the zip file and upload it to the new location. Just remember that ZIP files should definitely be treated as binary by your FTP client, so set your upload/download mode to binary right away.-<

Unzip it!

When you are sure that the zip file is in the correct location for your new site, just unzip it: 'unzip mysite.zip'. No more magic than that. You'll see your folder structure recreated the way you developed it.-<

Make it work on your new site

Coranto not working anymore? Tons of 404's and other errors? Yup. No wonder, since EVERY path has probably changed from the old to the new location. Now this is where we are going to take advantage of the fact that Coranto stores all of its settings in plain text. We are going to use a tool called rpl, which replaces text in files and can recurse into subdirectories. It's also one single executable file, so you shouldn't have any problems running it on your server (they would be VERY VERY strict not to allow you to). Just download it using wget or a similar tool, or even download it to your local computer and upload it via FTP to your new www root directory. Go here to download.

Next, we are going to replace EVERYTHING. All your Coranto profiles, styles, settings, viewnews.cgi, coranto.cgi, anything that could possibly have your old path in it. To do this, get hold of the ABSOLUTE path to your OLD installation. Then the one to your NEW installation. I will use /home/old/www/dev/coranto and /www/public_html/coranto as an example of old and new, and the command will be this:

'rpl -iRa "home/old/www/dev/coranto" "www/public_html/coranto" *'

You probably guessed what this does allready. The -i flag is for ignore case (which is probably superfluous since nix file systems are case-sensitive anyway), the -R is to recurse into subdirectories and the -a is to process files and directories starting with a dot (.) as well. Note that both of the strings are enclosed in quotation marks.

Tam tam tam. All done. Almost. Now all we have to do is to replace all occurences of the URL as well. If the old URL to Coranto was http://dev.myoldsite.com/coranto and the new one is http://www.finished.com/coranto, then just do:

'rpl -iRa "dev.myoldsite.com/coranto" "www.finished.com/coranto" *'

This should do the trick for you! If Coranto complains, verify that chmod settings hasn't been altered during the process, that your new server has perl installed (possibly you'll need to change the path to perl in the first line of coranto.cgi and viewnews.cgi) etc. etc. If you still have trouble, why don't come ask us in the forums?

Good luck! SrNupsen

Categories:




Page last modified on February 02, 2009, at 06:38 PM