Re: web server migration

2011-12-11 Thread steve reilly

On 12/11/2011 10:40 AM, Avi Greenbury wrote:


Basically, I would:

* Manually install the packages on the new machine. You can use dpkg
   --set-selections and friends, but for just a website you're probably
   looking at<10 packages and here's a good chance to not also install
   everything you used to want on the previous machine.
* Create a database on the new machine and populate it (by dumping out
   of the old one and importing to the new one)
* Tar up the site, scp it across, untar it into the document root on
   the new server.
* Edit your /etc/hosts file to point the domain at the new server,
   poke around the site and check that everything's in order. Fix stuff
   that isn't.
* Do another dump-and-transfer of the SQL (and files if neccesary)
* Switch your router to point incoming web traffic at the new machine
   and not the old one.


hi, thanks for the input.  ive been leaning this way, a boatload of info 
around on this as well.  iso downloading now, gonna spend some time on 
this today.  bittorrent is crazy, 1.6MB/s, insane fast!


steve


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ee4dbf9.9070...@roadrunner.com



Re: web server migration

2011-12-11 Thread Avi Greenbury
steve reilly wrote:

> question.  how would YOU do it with minimal hassle, ie. having to
> edit config files, databases and such.  this thing has been running
> since etch and been a learning process along the way  i doubt my
> idea of cloning would work, but?

If they're relatively small and static, it's quite hard to get wrong :)
If there's no DNS to change (as it sounds like there wont be) it's even
harder.

Basically, I would:

* Manually install the packages on the new machine. You can use dpkg
  --set-selections and friends, but for just a website you're probably
  looking at <10 packages and here's a good chance to not also install
  everything you used to want on the previous machine.
* Create a database on the new machine and populate it (by dumping out
  of the old one and importing to the new one)
* Tar up the site, scp it across, untar it into the document root on
  the new server.
* Edit your /etc/hosts file to point the domain at the new server,
  poke around the site and check that everything's in order. Fix stuff
  that isn't.
* Do another dump-and-transfer of the SQL (and files if neccesary)
* Switch your router to point incoming web traffic at the new machine
  and not the old one.

If you've a DNS change to make, then you need to bear in mind that
during the propagation time (which is always at least 30 minutes)
visitors could hit either site (and, therefore, DB). I'd, then, point
the old site at the new DB. You still may need to manage traffic
writing to the db while your dumping,scping,importing and then changing
config, but not normally on family sites :)

Most of the migrations like this that I do are relatively simple PHP
sites (wordpress, or home made), you may have complications with
Postgres if that's what you've used, though. Perl hardly changes in
Debian and maintains backwards compatibility, so that's fine.

You will go from PHP 5.2.x to 5.3.x in Lenny -> Squeeze, though. that
doesn't break things quite as much as 4.x to 5.x did, but there's a
couple of changes that do break things. I'm not enough of a PHP
developer to know precisely what they are, though, so it's a good idea
to check everything does do what you want it to before migrating it
properly.

-- 
Avi


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111211154031.03a94cb4@amazing



Re: web server migration

2011-12-11 Thread steve reilly

On 12/11/2011 02:58 AM, Alan Chandler wrote:


Although my explanation may seem quite complex, it works out as really
useful tidy way to manage sites. They always need updating from time to
time and it is quite hard to remember all the details if you work with
lots of different sites. With my mechanism its simple - ensure you are
on branch master with git (my command line prompt actually includes the
branch name in square brackets when ever I am inside a git repository*)
make the changes and test locally. When you are happy with them do

thanks for taking the time to detail your setup, keeping it in mind.  I 
can tell youve been at this awhile longer than myself!


steve


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ee4c60a.6070...@roadrunner.com



Re: web server migration

2011-12-11 Thread steve reilly

On 12/11/2011 03:47 AM, bruno.deb...@cyberoso.com wrote:


I would first move to some virtualisation in order to make the next
migration easier (I am currently using OpenVz containers with Proxmox
ditro, but there are many others out there)


thats something i didnt think of, thanks, ill look at it.



So you could create a virtual machine on your new server, and rsync the
old one directly in the virtual machine. You'll have to change a couple
of things (there have already been many threads about that in this list)

I would not do both upgrade to squeeze and migration at the same time,
as you would double the risks of getting into problems.
You could make clones of this virtual machine to test an upgrade to
squeeze of your production environment afterwards.


good thought, ive really got too much time invested in the 3 sites to 
muck things up! thanks.




If you stick to pure hardware server, rsync works great as well (there
have already been many threads about that in this list)

My 2 cents,

Bruno





--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ee4c43c.70...@roadrunner.com



Re: web server migration

2011-12-11 Thread bruno.deb...@cyberoso.com
Le Sat, 10 Dec 2011 18:46:56 -0500,
steve reilly  a écrit :

> On 12/10/2011 05:38 PM, Mark Neidorff wrote:
> > More information needed, please.  You said that your desktop
> > machine is running lenny.
> 
> yes, it is.
> >
> > I'll start with a few questions and let other folks add theirs
> >
> > 1. Do you want to try squeeze on the poweredge or stay with lenny?
> > Is the hardware in the server supported in lenny or do you have to
> > use squeeze?
> yes, would be installing latest stable, squeeze.  as far as I can
> tell, I had no problems with hardware, i installed squeeze on one of
> the drives when i got it couple weeks ago.  only thing that did not
> work was usb ports.  i figured thatd be easy enough to fix, but i
> dont need them anyway. raid is embedded and run at hardware level so
> no drivers needed for that.  pretty sure on that anyway.
> 
> > 2. Are you going to use raid on the disks?  (remember you are using
> > about 4gb now).
> with 2 73 gb drives installed the raid config (perc3) gives me 2
> options when i create a container, raid zero, which i dont want, or
> raid one (mirrored) so thats what i planned on using.  plan on
> getting a 3rd drive down the road for hot spare. once i get up and
> running im assuming the raid config has option for that.
> 
> > 3. What else is the server going to do for you, now and in the
> > future?
> strictly webserver.
> 
> > 4. What web server are you using and what version is it?  What are
> > you planning to use on the new machine?
> currently apache2- 2.2.9, sticking with apache on new one, looks like 
> 2.2.16 on squeeze
> 
> > 5. What provisions are you making for backups?
> automated daily wordpress, database zip backups to another machine in 
> the house, plus the raid one (main reason i got the new server was so
> i had some sort of redundancy) guess i could have just got a raid
> card, but this poweredge was wicked cheap.  got from a government
> contractor friend.
> 
> thanks
> 
> steve
> 
> 
> 
I would first move to some virtualisation in order to make the next
migration easier (I am currently using OpenVz containers with Proxmox
ditro, but there are many others out there)

So you could create a virtual machine on your new server, and rsync the
old one directly in the virtual machine. You'll have to change a couple
of things (there have already been many threads about that in this list)

I would not do both upgrade to squeeze and migration at the same time,
as you would double the risks of getting into problems. 
You could make clones of this virtual machine to test an upgrade to
squeeze of your production environment afterwards. 


If you stick to pure hardware server, rsync works great as well (there
have already been many threads about that in this list)

My 2 cents,

Bruno


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111211094747.153339bc@bruno



Re: web server migration

2011-12-10 Thread Alan Chandler

On 10/12/11 22:26, steve reilly wrote:

good afternoon

looking for input on moving a couple small family websites from a
desktop machine running lenny to a poweredge 4600 I just bought.
poweredge has two 73gb scsi drives, perc3 embedded raid. in process of
formatting drives, and then setting up container. desktop has a 300gb
drive, all one partition, but only about 4gb used. ideally would like to
just somehow dd or rsync contents of the desktop to the other machine.

question. how would YOU do it with minimal hassle, ie. having to edit
config files, databases and such. this thing has been running since etch
and been a learning process along the way i doubt my idea of cloning
would work, but?




I manage quite a few different web sites, including my own personal one 
based on Wordpress. Generically they are all managed in a similar way, 
although to be fair, there is a slight difference in how I manage my 
workpress one.


Firstly, in general, I have two versions of the web site.  One that 
remains on my desktop where I develop changes to it, and one that 
resides on the production server, wherever that may be.  My home server 
runs a copy of dnsmasq as a dns server for the house and has a config 
file that defines lots of host names for my desktop machine. These name 
let me know what site I am using but all sit in the .home domain - so 
for instance, my production site is www.chandlerfamily.org.uk, my home 
equivalent if cf.home.  Another site I manage is 
www.melindasbackups.com, my home machine is mb.home.  etc etc


I run the apache2-mpm-itk package on my desktop.  This allows me to add 
the AssignUserId directive to my virtual host config to ensure that I am 
reading and writing files to the location in my home directory as me 
rather than the more normal www-data.


I run local copies of mysql and postgres (and sqlite) on my desktop 
machine as they are all databases that drive the different sites I 
manage.  There are mostly copies I have taken of the production site, 
although I normally ensure that the password to access them is different.


The web site itself is stored in a git repository. Generally speaking 
there is the files that make up the web site itself - stored in a sub 
directory called web plus other important supporting files (for instance 
the apache config) which are stored in other directories.


The important part is post commit/post-merge hooks (stored in 
.git/hooks/post-commit with .git/hooks/post-merge symlinked to it). Here 
is the version I use with my Wordpress site (which, as I implied above I 
manage slightly differently to the other sites, as I only update the 
theme files this way).  Nevertheless it shows the key use


#!/bin/bash
#
#  If merging or committing to site or test branches, load up 
appropriate directories on host

branch=$(git branch | sed  -n s/^\*\ //p)
version=$(git describe --tags)

cd "$(git rev-parse --show-cdup)"
echo "" > web/inc/version.inc

if [ "$branch" == "site" ]; then
# Copy all to the theme directory on main site
rsync -aqz --delete ./ 
www-data@owl:/var/www/chandlerfamily/wp-content/themes/czen/

fi

#   Changelog
#
#   02 Mar 2011 - Initial version after setting theme as its own repository


This interesting part is how I parse the git branch I am on, and 
establish a version number for the site.  The version gets embedded into 
a file for inclusion on the site, then IF I am on the site branch I use 
rsync to ssh copy the appropriate files to the appropriate place on the 
production server.


(With wordpress, I allow its own update mechanisms to install and manage 
itself and the plugins - with other packages - particularly the SMF 
forum I use quite a bit I use a different mechanism that is detailed in 
this article


http://www.chandlerfamily.org.uk/2011/03/managing-smf-software-in-git/

)

Although my explanation may seem quite complex, it works out as really 
useful tidy way to manage sites.  They always need updating from time to 
time and it is quite hard to remember all the details if you work with 
lots of different sites.  With my mechanism its simple - ensure you are 
on branch master with git (my command line prompt actually includes the 
branch name in square brackets when ever I am inside a git repository*) 
make the changes and test locally.  When you are happy with them do


git checkout site
git merge master
(site is automatically updated to new version)
git checkout master


* The command line prompt is set in .bashrc
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(output-git-head-or-blank)\$ 
'


with the command output-git-head-or-blank being

#!/bin/bash
PS_GIT=$(git symbolic-ref HEAD 2>/dev/null)&&echo "[$(basename 
$PS_GIT)]"&&exit


# else output nothing





--
Alan Chandler
http://www.chandlerfamily.org.uk


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists

Re: web server migration

2011-12-10 Thread Miles Fidelman

steve reilly wrote:
looking for input on moving a couple small family websites from a 
desktop machine running lenny to a poweredge 4600 I just bought. 
poweredge has two 73gb scsi drives, perc3 embedded raid. in process of 
formatting drives, and then setting up container. desktop has a 300gb 
drive, all one partition, but only about 4gb used.  ideally would like 
to just somehow dd or rsync contents of the desktop to the other machine.


question.  how would YOU do it with minimal hassle, ie. having to edit 
config files, databases and such.  this thing has been running since 
etch and been a learning process along the way  i doubt my idea of 
cloning would work, but?


and


4. What web server are you using and what version is it?  What are you
planning to use on the new machine?
currently apache2- 2.2.9, sticking with apache on new one, looks like 
2.2.16 on squeeze



5. What provisions are you making for backups?
automated daily wordpress, 


Ok... so this is about moving a wordpress installation from one machine 
to another.


If it were me, I'd:

1. Get your Debian installation working.

2. Install MySql & Apache, copy your config files, tweak as necessary.

3. If you have any static files being served by Apache, move them over.

4. Install Wordpress.

5. Follow the directions at http://codex.wordpress.org/Moving_WordPress

6. If you have anything else running under your webserver (e.g., a wiki 
package), look for application-specific migration instructions and 
follow them.


Miles Fidelman





--
In theory, there is no difference between theory and practice.
In practice, there is.    Yogi Berra



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ee3f786.3040...@meetinghouse.net



Re: web server migration

2011-12-10 Thread steve reilly

On 12/10/2011 05:38 PM, Mark Neidorff wrote:

More information needed, please.  You said that your desktop machine is
running lenny.


yes, it is.


I'll start with a few questions and let other folks add theirs

1. Do you want to try squeeze on the poweredge or stay with lenny?  Is the
hardware in the server supported in lenny or do you have to use squeeze?
yes, would be installing latest stable, squeeze.  as far as I can tell, 
I had no problems with hardware, i installed squeeze on one of the 
drives when i got it couple weeks ago.  only thing that did not work was 
usb ports.  i figured thatd be easy enough to fix, but i dont need them 
anyway. raid is embedded and run at hardware level so no drivers needed 
for that.  pretty sure on that anyway.



2. Are you going to use raid on the disks?  (remember you are using about 4gb
now).
with 2 73 gb drives installed the raid config (perc3) gives me 2 options 
when i create a container, raid zero, which i dont want, or raid one 
(mirrored) so thats what i planned on using.  plan on getting a 3rd 
drive down the road for hot spare. once i get up and running im assuming 
the raid config has option for that.



3. What else is the server going to do for you, now and in the future?

strictly webserver.


4. What web server are you using and what version is it?  What are you
planning to use on the new machine?
currently apache2- 2.2.9, sticking with apache on new one, looks like 
2.2.16 on squeeze



5. What provisions are you making for backups?
automated daily wordpress, database zip backups to another machine in 
the house, plus the raid one (main reason i got the new server was so i 
had some sort of redundancy) guess i could have just got a raid card, 
but this poweredge was wicked cheap.  got from a government contractor 
friend.


thanks

steve



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ee3ef70.4020...@roadrunner.com



Re: web server migration

2011-12-10 Thread Mark Neidorff
More information needed, please.  You said that your desktop machine is 
running lenny.  

I'll start with a few questions and let other folks add theirs

1. Do you want to try squeeze on the poweredge or stay with lenny?  Is the 
hardware in the server supported in lenny or do you have to use squeeze?
2. Are you going to use raid on the disks?  (remember you are using about 4gb 
now).
3. What else is the server going to do for you, now and in the future?
4. What web server are you using and what version is it?  What are you 
planning to use on the new machine?
5. What provisions are you making for backups?

Mark
On Saturday 10 December 2011 5:26:34 pm steve reilly wrote:
> good afternoon
> 
> looking for input on moving a couple small family websites from a
> desktop machine running lenny to a poweredge 4600 I just bought.
> poweredge has two 73gb scsi drives, perc3 embedded raid. in process of
> formatting drives, and then setting up container. desktop has a 300gb
> drive, all one partition, but only about 4gb used.  ideally would like
> to just somehow dd or rsync contents of the desktop to the other machine.
> 
> question.  how would YOU do it with minimal hassle, ie. having to edit
> config files, databases and such.  this thing has been running since
> etch and been a learning process along the way  i doubt my idea of
> cloning would work, but?
> 
> 
> 
> Steve


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/201112101738.44484.m...@neidorff.com



web server migration

2011-12-10 Thread steve reilly

good afternoon

looking for input on moving a couple small family websites from a 
desktop machine running lenny to a poweredge 4600 I just bought. 
poweredge has two 73gb scsi drives, perc3 embedded raid. in process of 
formatting drives, and then setting up container. desktop has a 300gb 
drive, all one partition, but only about 4gb used.  ideally would like 
to just somehow dd or rsync contents of the desktop to the other machine.


question.  how would YOU do it with minimal hassle, ie. having to edit 
config files, databases and such.  this thing has been running since 
etch and been a learning process along the way  i doubt my idea of 
cloning would work, but?




Steve



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ee3dc9a.1090...@roadrunner.com