homepage Welcome to WebmasterWorld Guest from 54.211.97.242
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Moving a large site efficiently
elementary Apache server questions
Robert Charlton

WebmasterWorld Administrator robert_charlton us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 81 posted 6:15 pm on Dec 14, 2002 (gmt 0)

I'm just getting my feet wet in moving a fairly large site, and I have some very basic Apache server questions.

On the server, in the Public folder, there are currently two subdirectories... mydomain.com, and a WS-FTP log folder.

When the site "goes live," I'd like to move things very quickly. Even if I had broadband, which I don't, it makes sense to have both the old site and the new site standing by online, so they can be switched back and forth easily.

What I'm wondering is whether I can put the new site into a subdirectory in the Public folder and call it, say, "newsite". Then when the moment comes...
- simply rename "mydomain.com" to "oldsite"
- and then change the name of the "newsite" folder to "mydomain.com".

I assume that under the current setup, calling the folder "mydomain.com" is what it takes to get the server to recognize it as the active root folder for the domain.

I'm also assuming that since there's already a WS-FTP log directory in the public folder, additional subdirectories in the public folder shouldn't create problems.

I don't know, though, whether it's considered bad practice to leave an old site in the public folder for a while. We'd like to have the old site standing by until we know there are no major bugs.

The new root will have an .htaccess file redirecting some critical pages... which I hope will make the transition go smoothly.

Tests have shown, incidentally, that the server doesn't seem to like me to remotely move or copy files from directory to directory on the server. It does allow me to rename directories.

 

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 81 posted 11:36 pm on Dec 14, 2002 (gmt 0)

When the site "goes live," I'd like to move things very quickly. Even if I had broadband, which I don't, it makes sense to have both the old site and the new site standing by online, so they can be switched back and forth easily.

Good plan.

What I'm wondering is whether I can put the new site into a subdirectory in the Public folder and call it, say, "newsite". Then when the moment comes...
- simply rename "mydomain.com" to "oldsite"
- and then change the name of the "newsite" folder to "mydomain.com".

It would be faster and less disruptive to make a copy of the old site first, then rename newsite to mydomain.com, letting it overwrite the old site, but you will still have your copy of the old site.
This makes the changeover pretty much instantaneous.

I assume that under the current setup, calling the folder "mydomain.com" is what it takes to get the server to recognize it as the active root folder for the domain.

It sounds like it... Maybe an "alias" set up by the hosting co. I'd ask them for the details if you can get past the first-level help desk...

I'm also assuming that since there's already a WS-FTP log directory in the public folder, additional subdirectories in the public folder shouldn't create problems.

No unexpected problems - you still have to be careful of conflicting file/directory names, but nothing special about that.

I don't know, though, whether it's considered bad practice to leave an old site in the public folder for a while. We'd like to have the old site standing by until we know there are no major bugs.

I'd consider that to be an excellent idea.

The new root will have an .htaccess file redirecting some critical pages... which I hope will make the transition go smoothly.

You might want to describe this in more detail - It shouldn't be necessary, except to cover some unique situation.

Tests have shown, incidentally, that the server doesn't seem to like me to remotely move or copy files from directory to directory on the server. It does allow me to rename directories.

All the more reason to use the plan you outlined, which is sound.

One caveat: Test the new site to make sure it doesn't mind living in a subdirectory. Specifically, you'll be looking for "location conflicts" caused by absolute URLs and <Base> tags.

Hey gang, let's have some more input on this subject - It's a major change! <bump>

Jim

DaveAtIFG

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 81 posted 2:55 pm on Dec 15, 2002 (gmt 0)

I was a little confused by this post at first read by
moving a fairly large site
I think the goal is to move to a new version of the site?

In any case, it looks like a good plan to me and jdMorgan has covered most of the issues. If the site uses scripting, there may be a few paths that need to be changed during testing, while the site resides in the offline subdirectory. This may also be true if absolute URL addresses are used anywhere in the site. If so, building a checklist of these "changed" items as they are encountered may be handy to insure they are all "put back to normal" before the site goes live, and to make it easier to switch between the old and new sites when going (or attempting to go! ;) ) live.

Robert Charlton

WebmasterWorld Administrator robert_charlton us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 81 posted 3:02 am on Dec 16, 2002 (gmt 0)

Thanks for the responses... Yes, I am building a new version of an old site...

>>It would be faster and less disruptive to make a copy of the old site first<<

Is there a way of doing this on the server rather than downloading and then uploading a second copy?

>>This may also be true if absolute URL addresses are used anywhere in the site. If so, building a checklist of these "changed" items<<

Yes, that's been one of the more tedious chores of the project... I have the new site with relative urls online in a test subdirectory now, with some pages with absolute urls standing by for when I know the rest of the site is OK and we're in the actual site directory so they'll work. One of the trickiest parts is changing over some framed content that can only be changed remotely online... but shouldn't be changed until the new site is up (as the path names will indeed be changing).

I've also been dealing with PPC landing page redirects, etc. At this point, I have lists of lists. My main concern is what I can do on the server... and what I can leave in the public_html directory. It's a little different than a local hard drive.

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 81 posted 3:27 am on Dec 16, 2002 (gmt 0)

>>It would be faster and less disruptive to make a copy of the old site first<<

Is there a way of doing this on the server rather than downloading and then uploading a second copy?

If you can get to a Unix prompt using telnet or any other way, you can do a recursive copy with the cp command, duplicating the entire directory tree. Many versions of FTP will let you pass a command line through to the OS, too.

Jim

Robert Charlton

WebmasterWorld Administrator robert_charlton us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 81 posted 3:33 am on Dec 16, 2002 (gmt 0)

PS... While I have access to such excellent help, I should double check the form of the .htaccess permanent redirects I'm using to direct old pages (all now in the root dir) to the default home page of the site.

Current form, which worked in my tests, is:

RedirectPermanent /oldpage.html [mydomain.com...]

This would be one line for each page. I've seen "RedirectPermanent" split into two words, and/or with different capitalization. I'm taking this form from the Apache documentation.

I'm also assuming that I need to spell out the full domain, ending with the trailing slash, as the redirect destination.

Also... after some debate with myself... I've decided not to redirect some old pages to the new pages that have specifically replaced them, rather than to the root. I'm directing everything to the default home page, figuring that if I redirected the pages to their replacements, if I had any internal linking problems involving the old pages, I'd never find them.

All thoughts welcome.

andreasfriedrich

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 81 posted 3:34 am on Dec 16, 2002 (gmt 0)

Or if that fails and permissions allow it use a script to do the copying for you.

Andreas

Robert Charlton

WebmasterWorld Administrator robert_charlton us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 81 posted 3:42 am on Dec 16, 2002 (gmt 0)

If you can get to a Unix prompt using telnet or any other way, you can do a recursive copy with the cp command, duplicating the entire directory tree. Many versions of FTP will let you pass a command line through to the OS, too.

Jim... This is total Greek to me, as I don't know Unix... and I'm not sure what telnet is. DOS is as far as I got before they flunked me out. I'm using WS-FTP and the FTP function in Windows Commander, and have Leech FTP standing by... so if one of these will work and you can give me the Unix copy syntax, I'm all for trying it... particularly if I can try it with a test directory first.

Is this something that requires special permissions, or is it just a question of getting to the Unix command line?

Robert Charlton

WebmasterWorld Administrator robert_charlton us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 81 posted 3:46 am on Dec 16, 2002 (gmt 0)

>>use a script to do the copying for you.
Andreas
<<

Thanks... Again, I little beyond me. I can create scripts for some programs I've used (I loved the scripting language for MS Word for DOS), but I'm looking for very simple, fail-safe approaches here.

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 81 posted 5:14 am on Dec 16, 2002 (gmt 0)

Robert,

Here's a description of the Unix copy command [mcsr.olemiss.edu].

telnet makes your computer act like a terminal plugged into your site host computer. You may have to check with them about login procedures - it can get sticky if the host has to be accessed through a proxy. When connected and logged-in, you get a Unix prompt - a Unix "DOS prompt".

The following two commands, entered while logged into the root of your site, should copy all files in all directories to the new directory "oldsite".

mkdir oldsite
cp -r * oldsite

If you're on good terms with their help desk and you trust their competence, you could just ask them to do the copy operation for you. However, I'd consider it good practice for the switchover to get these tools lined up and working, and get familiar with them before it's time to go live.

Foolproof is good, Murphy's-Law-proof is even better!

Jim

DaveAtIFG

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 81 posted 5:20 am on Dec 16, 2002 (gmt 0)

No offense Robert but with your limited familiarity I think the best approach might be to either ask your host to make a copy of the site for you (doubtful) or to use LeechFTP. I've never used it but it's said to be the fastest FTP available. Under the circumstances, backing your old site up is an important step. Invest the time necessary to get it done and let's hope you don't need to use it! :)

Robert Charlton

WebmasterWorld Administrator robert_charlton us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 81 posted 8:42 am on Dec 16, 2002 (gmt 0)

Dave - The old site is backed up... actually in multiple cities. I just don't have a second copy of it sitting on the server. Though the software I have has allowed me to create and rename directories remotely without a glitch, it doesn't let me copy from directory to directory. Your advice is well taken, and I will ask the hosting company to put a backup in a directory called "oldsite." Thanks...

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved