Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2003
    Posts
    324

    Question Apply update to multiple websites?

    Wasn't sure exactly which forum this fit in, and I greatly apologize if it's in the wrong one.
    ----

    I just got hired to maintain about 40 websites with more being added to the list everyday.

    All the websites have the same directory/file structure as they all use the same script.

    I found a bug in the script and needed to modify several core files to fix the bug. Right now I'm logging into each website manually via FTP but it's taking to long to do this on an individual basis.

    Here is my question, how can I upload or how should I go about updating these 40 websites with the newly modified files in a streamlined process instead of doing it one by one?

    A. All websites except for about 10 or so are on the same dedicated server which I have root access to. The server is CentOS with CPanel installed.

    B. Every website is on it's own separate hosting account on the server.

    C. I have FTP access to every website.

    Thank you in advance for taking the time to read this and reply.

  2. #2
    Join Date
    May 2004
    Location
    Pflugerville, TX
    Posts
    11,222
    It sounds to me like this network of sites was not thought out very well, if you're having to update separate files manually in order to affect common elements. At the very least, all common elements should be kept in a separate file area and called into every site (there are ways to accomplish this even from multiple servers, though a single server is DEFINITELY preferable). At best, a CMS that can drive updates, files, preferences, etc. from a single location and single database sounds like it would make your life easier.

    Of course none of this helps your immediate needs, but maybe it's time to talk with the owners of this network about rebuilding the backend so it is more efficient?

    Short term, you might be able to set up software to map to the various accounts on the dedicated and ancillary servers, open up all the pages that need the same change, and do a global search/replace. The danger with this is if you do it wrong, the change it now live across the entire network and it becomes a real PITA to revert it. My software choice for this sort of work is Homesite, but you can't purchase this software anymore (Adobe announced EOL on Homesite in May 2009). I'm sure Dreamweaver can do the same thing too, though I would only use it in code mode - it (and all WYSIWYG editors) are nearly useless and/or dangerous in any mode other than code mode.
    Studio1337___̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡.__Web Design

  3. #3
    Join Date
    Oct 2004
    Location
    Shimonoseki
    Posts
    2,101
    Dreamweaver has a very comprehensive search/replace function, including the ability of using regular expressions. But it cannot operate on multiple FTP accounts in same time.

    One thing comes to mind is, make all the changes in one website, take a record of the files edited. And copy/overwrite them over other accounts.
    You will need to use wget or a similar tool to do it cross-server though. I am not a Linux expert, but there must be a way to automate it via shell scripting. PuTTY Connection Manager might be useful in this case.
    Closed for winter...

  4. #4
    Join Date
    Nov 2003
    Location
    Marylebone, London, UK
    Posts
    526
    if they all have the same dir structure, e.g.
    /home/site1/htdocs/..
    /home/site2/htdocs/..
    etc..

    and you're simply replacing the same file under each,
    you could:
    1) put each path (one per line) in a file

    2) write a shell script, to copy over the new file,
    (not the file in 1) above of course!)
    reading the above file in a loop

    3) you may get 40+ password prompts, so you'd be
    better off creating one account, or use using an existing
    one where you can set up ssh-keys to do this with no
    password prompt.

    simply supply the new file name as arg to your script
    and you're off. a little work now, and less later!

  5. #5
    Join Date
    Mar 2009
    Posts
    2,218
    Quote Originally Posted by damainman View Post
    Here is my question, how can I upload or how should I go about updating these 40 websites with the newly modified files in a streamlined process instead of doing it one by one?
    Develop a batch file to do FTP uploads to each site.

    What you should do is upload the files under new names, then rename them ... that way the running web sites will not see partially-uploaded files.

    Sometimes you may need more elaborate control; for example, if the uploads can take a long time, you might want to create a duplicate directory structure, then rename that at the top level. That means you can separate the delivery of the new files from their activation.

  6. #6
    Join Date
    Nov 2003
    Posts
    324
    Wow, wasn't expecting so many replies so soon. Thank all of you.

    The network of websites are not your usual setup. It's basically a bunch of domain owners who joined together to create a network. Each website is owned by a different owner, so the websites have different content but use the same core scripts. I can't really create a central location where every website calls it's information from the same place, because not all websites are hosted on the same server.... and the domain owner at any time can decide they don't want to use our services no more and just start doing administration on the website, or hire someone else to do it, or switch to a different host at any time.

    The website owners initially were members of another network and hosted on a cloud server. The updates at that time were done in SSH using some type of script. However the other network stole alot of their money so they switched over to our services and we migrated all their websites over.

    To be completely honest I've never wrote a bash script or batch file which is why I was hoping there might be a program to accomplish this or maybe a method similar to SVN.

    I might be able to find the script they used to roll out the updates before. However their old server was a completely different setup so not sure how useful it would be.

  7. #7
    Join Date
    Mar 2009
    Posts
    2,218
    Quote Originally Posted by damainman View Post
    To be completely honest I've never wrote a bash script or batch file
    You may find your ftp or stfp command has a -s or -b option, which allows you to specify a file containing the FTP operations to be performed.

  8. #8
    Join Date
    May 2009
    Posts
    766
    Sounds like a job for CVS/Subversion. You only update files in one non-development area and when they're tested, you check them out on all the satellite machines.

    I'd probably combine a version-control system with a shell script that runs around to all the different machines and performs the checkout.

Similar Threads

  1. How often does Google update their PR for websites?
    By saukwebsolutions in forum SEO / SEM Discussions
    Replies: 47
    Last Post: 01-06-2010, 10:32 AM
  2. Mysql multiple table update/multiple delete
    By ilyash in forum Programming Discussion
    Replies: 3
    Last Post: 11-18-2008, 12:26 PM
  3. How often do you update your websites?
    By matt4 in forum Web Design and Content
    Replies: 3
    Last Post: 09-01-2007, 03:37 AM
  4. how to apply multiple background image in 1 page
    By zola in forum Web Design and Content
    Replies: 3
    Last Post: 07-28-2005, 10:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •