# Upgrading from FreeBSD 8.1 to latest stable version.



## hockey97 (Jan 1, 2014)

Hi, how can I safely upgrade from freebsd FreeBSD 8.1 to the latest version of freebsd FreeBSD?  I don't want to wipe everything off my server. Just want an upgrade without a clean install. My package manager is having issues generating errors. *W*hat are the commands to upgrade freebsd FreeBSD to _the_ latest stable version?

The error I get in the add / remove software program or package manager:


```
The backend exited unexpectedly. This is a serious error as the spawned backend did not complete the pending transaction.
```


----------



## junovitch@ (Jan 1, 2014)

What command caused the error message?  I don't recognize it.  The safe bet would be to follow the instructions to upgrade to 8.4-RELEASE.  That should hold you over with another year and a half of support.  Link:  http://www.freebsd.org/releases/8.4R/installation.html.  That would only upgrade your base system though.  You'll have to upgrade packages afterwards.  Technically you don't have to rebuild all packages but if the machine hasn't been maintained for some time as I suspect then you'll have to anyway to get everything up to date.  The fastest way would probably be to upgrade via the instructions linked and bootstrap pkg afterwards.  Once that's done, you can simply run `pkg upgrade -fy` to force a reinstall of all packages from the public repositories.  That's contingent on if the default options were used for your package builds and if you are very far behind, you'll probably have to make sure all your add-on software upgraded properly by hand.


----------



## kpa (Jan 1, 2014)

I think the OP here is trying to use the broken package manager of the GNOME2 desktop to upgrade the OS. That is not going to work because the package manager if it worked would only update the installed packages to the latest versions available for FreeBSD 8.1. The handbook as pointed out by @junovitch has the proper instructions for upgrading FreeBSD to a newer version.


----------



## hockey97 (Jan 2, 2014)

So, if I follow that link to the handbook I will be able to upgrade to 8.4*?*  I wonder if the server configuration files will still be saved? I have my server configured to the right settings and don't want to have to reconfigure many different servers on my computer.


----------



## hockey97 (Jan 2, 2014)

Hey, guys how can I skip the long listing of all the files and folders being deleted?

I typed `freebsd-update  upgrade 8.4 release`. It starts to inspect my system  and then asks me yes and no questions. *A*fter pressing 'y'  many times it then gives me a long list of directories that will be deleted. I typed in `:q!` and it closes the process and nothing is installed. I want to use a command to skip those long lists. I googled around and found nothing.


----------



## ljboiler (Jan 2, 2014)

When you see that "--More--" thing at the bottom of the screen, that usually means that a "pager" program is running (`more` or `less`) to give a screen-by-screen dump of a lot of output; type "q" to quit that pager program and move on to the next thing that `freebsd-update` wants to do.


----------



## junovitch@ (Jan 3, 2014)

To answer your earlier question regarding preserving configuration files, freebsd-update() uses the merge() tool to figure out what has change between versions and update as needed.  Most configuration files will just be updated to the new version if you did not change them.  For the files that you manually changed, it will show you a comparison of the old and new and you just will need to do a little vi work to preserve your modifications while updating to the new version.  If you are comfortable with vi and read closely, it's a fairly simple and quick process if you haven't made too many changes under the /etc directory.


----------



## hockey97 (Jan 3, 2014)

I did what you guys ask. I now have a broken system. I upgraded to 8.4 and got a[]lot of errors on the reboot. I followed that ha*n*dbook exactly. I also made a backup of my system and saved it in a .bz2 format. 

Now, I used bzcat  in the /bin/sh  to recover. I only see on the screen a bunch of data that looks like source code of files streaming on the screen. I am not sure if this is what I should be seeing.  What should I see after using the bzcat command. Should I see a ton of source code or text on the screen streaming meaning keeps changing in mil*l*iseconds and a beeping noise coming from my server is sounding as if  you kept pressing 'k' too many times, that type of beep.


----------



## junovitch@ (Jan 3, 2014)

If you followed this http://www.freebsd.org/releases/8.4R/installation.html exactly you shouldn't have had issues for most configurations.  If you do use something very specific that is covered if the detailed release notes you may have to make some changes.  If you have installed any software dependent on kernel modules, like VirtualBox, you may have to do some extra work there.  You'll have to be more specific than "a bunch of data that looks like source code".


----------



## hockey97 (Jan 3, 2014)

junovitch said:
			
		

> If you followed this http://www.freebsd.org/releases/8.4R/installation.html exactly you shouldn't have had issues for most configurations.  If you do use something very specific that is covered if the detailed release notes you may have to make some changes.  If you have installed any software dependent on kernel modules, like Virtualbox, you may have to do some extra work there.  You'll have to be more specific than "a bunch of data that looks like source code".



Yeah, I followed it exactly. I was able to reboot and load into the FreeBSD 8.4 kernel. When I use `bzcat` it turns the computer screen to a black color and starts streaming in data on the screen. It's the text you commonly see if you open up a .exe file in Notepad. If you ever open such files in Notepad you will see gibberish text. This is what I see streaming on my screen while the computer makes beeping noises.  There's not specific code or data that I can give since it's constantly changing on the screen in milliseconds. 

The problem I have when I restart my server is that it ends in the booting process with an error saying that there's a syntax error on line 32 in /etc/defaults/rc.conf it says that redirection unexpected. It then asks me to type in full path to shell or type return to go to /bin/sh It stops my booting of the OS.


Update: I fixed the problem. That filed had places where the server added <<<<<<< and ////// and deleted the done text. I added them back in and now my server boots up fine. Expect it does spit out that this rc.conf is spitting out mailparse errors at boot.

I would like to ask if I should upgrade to 10.0 when it's released?  I  want to switch to the latest OS version to not have to worry about upgrading for a while.


----------



## junovitch@ (Jan 4, 2014)

Did you update the kernel and userland?  You have to run `freebsd-update install` twice.  First to update the kernel, then reboot, then again to update userland.  If so, what does `uname -a` return?  If it returns 8.4-RELEASE, then try running `freebsd-update IDS` to check hashes of files installed to make sure that the kernel and userland are updated properly.  You should certainly not see corruption when running a simple utility on the system as you described.

For an error on line 32, can you show that line?  Just run `sed -n '32p' /etc/defaults/rc.conf` and post.  This isn't a file modified by users as it sets the default so an error there doesn't make sense.  Just as I finished typing that I see the part about the <<<<<<< //////// highlights added by the merge() program.  Good catch.

For mailparse errors, if you can post exactly the error I can probably help.

Upgrade to 10.0 is up to you.  Stuff doesn't change too much between minor releases, at least as far as administrator changes.  It does change between major releases so you may want to read the release notes when 10.0 is released to make sure nothing will be an issue.  It depends on what you are using the server for.  For major upgrades you either have to reinstall all packages or install the misc/compat8x port so all your add on software will work.  If you are doing that anyway as part of upgrading to 8.4, then you can do the same steps when you decide to upgrade to 10.

10.0-RELEASE information is under release engineering on the home page. http://www.freebsd.org/releases/10.0R/schedule.html

8.4-RELEASE info is under the security page.  It's supported until 2015 http://www.freebsd.org/security/


----------



## hockey97 (Jan 4, 2014)

When I  type in `uname -a` I get it saying my host name and  8.4-RELEASE. I then tried typing the command `freebsd-update IDS` and it spits this out:


```
/boot/kernel/linker.hints has SHA256 hash 74c3354528a6516a107c3eff67551d304fa0c560e73c54ab1b07cd9cd818fe1f, but should have SHA256 hash b610647fdd604b5ea4e1633b08eff1ff40fccac5d9cb71db44288b1a9280c806.
/etc/defaults/periodic.conf has SHA256 hash 22cea9daba00cc91ab4d168441bcfb46988cf89b3c45abf66d59c18fcff2bcf7, but should have SHA256 hash de1cb255935cb5122028037d2e54374f1db6fd029a2062fd3645ecf3193f54c5.
/etc/defaults/rc.conf has SHA256 hash 2d5f553fb4ac425b8d4d7f3facf5b90da01571931c91cedd504842283ffb9c2c, but should have SHA256 hash 7a3b25643759d53621bff49753dc70e4a3a0e542c8457fad8d82ee58fad7a91f.
/etc/dumpdates has SHA256 hash abf83810a537f8796e22ba19ce8204be8e75724efced5c95eebae925ea15f5a3, but should have SHA256 hash e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.
/etc/group has SHA256 hash 481aca12f5e2dcfe47a14a229a935768baf051c28f652bcb26dc548971efbf1d, but should have SHA256 hash e729c59a23e347be36336b5cb184f044cb5adbcb0d0918d99f55f4c01f05fe3a.
/etc/hosts has SHA256 hash 324ffadb1f01c07b31fcb946f576cfe128202098bb3f3ec4fba7d7409ff9e9bd, but should have SHA256 hash 31926abbb810d2da60bdbd0e715f9eed51b2769f53482bdc98f310aa7547287e.
/etc/inetd.conf has SHA256 hash 904f73475278b758b9c8530b4e627881c7ec3854bfe578dffa1cbcdce5d85c80, but should have SHA256 hash a174001457afaebc9e73a3d4be44c41a6911a8dda34c39923b0d05b42a710db6.
/etc/mail/aliases has SHA256 hash b2186b347df25e0d2cb1e015d13b847b8450da3d744f283db7f48d3eb6353443, but should have SHA256 hash 5b45faf7c2c67afb122d353ad9249b68454fbf92d01eb592a75f0c43c77bec53.
/etc/mail/mailer.conf has SHA256 hash f0dab3a9d7f007529f44f07d1bc489d32ca248ca21c13daf28f8be6bcb965164, but should have SHA256 hash 25045722d5107d92585db5c9a88e7add698a2d9e1b09d80139662d9f21fb6ebf.
/etc/mail/sendmail.cf has SHA256 hash afb692f40b6af528d5ef50d2b86cfade2bc6175e1088e87412984df619a3bbda, but should have SHA256 hash 801c6b864938506c2af691150ba7edaa5d9362acc1c0a36fe5615bbac4b80bb6.
/etc/manpath.config has SHA256 hash da3b8818997bd0b1701f1343b6fbfe59b483615e3d3387908b94788b2c1bd640, but should have SHA256 hash 1b71a2c3f82324e12c16e9ecef72f00dd469b0ef7bc7d45004b5c80ccd433321.
/etc/master.passwd has SHA256 hash bae16d858366d1260eec2754451a9dfbf440131a466b00c301899d397321f546, but should have SHA256 hash 1cd6ff07da164a4dbfa1cc8550282b457d0a2aed2aea27af5ff9d88a27cda7da.
/etc/motd has SHA256 hash 4d059f238b0e1e7e20c758046093addbc5fc4b21084ca42556c7d87b3ff16c12, but should have SHA256 hash ba25bc1d24e50377ebaaa125c2322cf590c238e001c2e11a54d956bc18c4832a.
/etc/nsswitch.conf has SHA256 hash e4f64cd29753dec16ef646155de93d9264e29b13fb0307f7da9cd8de31750f4a, but should have SHA256 hash 4b2297961570d6e98b39241106cc318bf5bb6adefd669fdb4907a349d1bbe08e.
/etc/passwd has SHA256 hash 1ff4472cf328459834c13f9f946cffdcb1f8197bf5ec8c11bc8666ada9b8322b, but should have SHA256 hash cc7c03dc754a9faa2aeb9d3aafe2da4a516401d272d59559c15803d1a01a6340.
/etc/ppp/ppp.conf has SHA256 hash af60fcd552b0e50d453216fee6e2c3500d6fc7a5cb7f191e1dad5920b2591924, but should have SHA256 hash e5e6959ed0310f06811d64625ce85ebacfe42f1ad4f99ff45af63e9a85bce3a8.
/etc/pwd.db has SHA256 hash b26793b2789cc1e442cdd9a9f721061b6245a80a502f7607407e7ba172f597e6, but should have SHA256 hash 10265dfafadd1b05598c1d5cec16a9fb42475e9061f78e36ee13eda50f2a2fb9.
/etc/shells has SHA256 hash 4556bd20f8360854ddeff604a820c7c7fcf58e9ebe6b177ea8b320a7a9db2b91, but should have SHA256 hash c473f3f864c7bd5280761de161f96f84c25fb5a65e3b10b704d006001400e14c.
/etc/spwd.db has SHA256 hash caf003fa5632d29051bc61e8840ce9b64d93616bebeeb17c755ebf01ded64b3d, but should have SHA256 hash 0811d890eceaf7733987ca695ef429bfae5d864edcbeb69abf8c04c4ddefc2fb.
```

I am using my server just to host websites. I  have PHP 5.3.2 installed and I need to install the PHP PDO MySQL driver.  I can't because the ports have only packages for PHP 5.4 etc.


----------



## junovitch@ (Jan 4, 2014)

Is this the PHP PDO MySQL driver port?  databases/php5-pdo_mysql in ports says it's for PHP 5.4.  Anyways, `freebsd-update IDS` only returning stuff in /etc is a good sign.  If it was full of stuff from /bin, /usr/bin, /sbin, /usr/sbin that would be a sign of an incomplete upgrade.  It does look like an issue that /etc/defaults/rc.conf and /etc/defaults/periodic.conf were flagged however.  Both of those files set the defaults and shouldn't be modified by administrators.  That's what /etc/rc.conf and /etc/periodic.conf are for, to override any of the defaults.


----------



## hockey97 (Jan 4, 2014)

Yes, that's the one. Yes, in ports I only find it for  PHP 5.4. The problem is that that I have PHP 5.3.2 installed. I would like to upgrade it to the newest one without losing any configurations. I been trying to look for one for the PHP 5.3.2 version.  :q


----------



## junovitch@ (Jan 4, 2014)

Well, 5.3.2 is very old and has about a dozen VuXML security entries (see http://www.vuxml.org/freebsd/pkg-php53.html). Sooner your later you'll either have to upgrade or watch your site get broken into. Why not set[]up a VM on your desktop/laptop or jail on that server to test your current configuration files with PHP 5.4? If you run into issues, there's a whole guide on migration on the PHP site here http://us3.php.net/migration54. If it works out as planned then just upgrade from the current ports tree or package repositories and move on.

Edit. There is a databases/php53-pdo_mysql as well. You can still stay on 5.3 but at least get to the latest revision with all the security fixes.


----------



## hockey97 (Jan 5, 2014)

junovitch said:
			
		

> Well, 5.3.2 is very old and has about a dozen VuXML security entries (see http://www.vuxml.org/freebsd/pkg-php53.html). Sooner your later you'll either have to upgrade or watch your site get broken into. Why not set[]up a VM on your desktop/laptop or jail on that server to test your current configuration files with PHP 5.4? If you run into issues, there's a whole guide on migration on the PHP site here http://us3.php.net/migration54. If it works out as planned then just upgrade from the current ports tree or package repositories and move on.
> 
> Edit. There is a databases/php53-pdo_mysql as well. You can still stay on 5.3 but at least get to the latest revision with all the security fixes.



I am thinking about upgrading to 5.4 or 5.5, as long I can upgrade and not make changes to the configuration. I am sure it's going to still work. The code I use is still supported. The only thing is that I use MySQL and the point of this upgrade is to also update my code to use PDO to deal with my databases. I have my own written functions that fixed the SQL injection security holes. Yet, now I decided it's time for a upgrade. I've got to do this before my website goes up live. I'd rather get all this done now than deal with it at a later time. How would I upgrade PHP to 5.4? *A*nd do you think I should upgrade it to PHP 5.5?

I currently have this installed: PHP 5.3.2 with Suhosin-Patch (cli) (built: Sep 16 2010 14:33:51)  However, when I try to install from ports the php53-pdo_mysql. I get this error : 
	
	



```
php53-pdo_mysql-5.3.28 cannot be installed: doesn't work with lang/php5 port (doesn't support PHP 5.2 5.4).
```
 I don't know why it thinks I have PHP 5.2 when PHP is telling me 5.3,  even with `php ---version` I get PHP spitting out versions 5.3.2


----------



## junovitch@ (Jan 5, 2014)

Honestly, it depends on your timelines.  I would check the PHP website to see what the End of Life (EOL) date is for the 5.3 series.  If it's far enough in the future, you already know your configurations work and can probably update without worry.  That would solve those security issues and would be you doing your due diligence before putting your site live.

If the EOL date seems too close and you have enough time, then upgrading now may be prudent.  Hopefully nothing needs to be tweaked but that's what the migration guides are for.  

You may be able to try forcing the PHP default version to get your packages to upgarade in your /etc/make.conf.  Maybe something like this:

```
DEFAULT_PHP_VER=53
```

Are you using ports-mgmt/portmaster to upgrade ports?  I've found that to be effective when I used it before switching to building my own repository with Poudriere.  `portmaster -af` usually resolved dependencies well enough.


----------



## hockey97 (Jan 5, 2014)

My server is no longer bootable now. For some reason while installing PHP it detected *P*erl was outdated. So, it updated it to the latest version and all software ended up broken. Then the system could only boot into the terminal. I then tried to reverse the process. Then some files ended up getting corrupted  and the shell no longer could run. So, I am at the point that I am thinking of installing a new OS. I did do backups but just found out those files ended up being corrupted. I couldn't bcat the dump to restore my backup. So, I will have to start all over and spend another two months trying to config_ure_ the system back to it's its original functionality. 

So, *s*hould I then use Freebsd FreeBSD 9.2 or should I wait for Freebsd FreeBSD 10?


----------



## junovitch@ (Jan 5, 2014)

That isn't right.  Ports are installed in /usr/local and that doesn't touch SSH or getty terminals that let you log you in locally. Worse comes to worse, you can get a list of packages with `pkg_info`, delete /usr/local (after backing it up), delete /var/db/pkg and reinstall your ports from the list. That will ensure you don't get tripped up in any dependencies.

Did you read /usr/ports/UPDATING?  Some software often has special instructions for updating.  When was the last time any ports were updated?  PHP was 2010, but was all software from that time?


----------



## wblock@ (Jan 6, 2014)

The output of bzcat(1) would have to be piped into some other program, possibly restore(8).  That type of thing is best tested before it's needed.  It's not clear where the advice to use that appeared, or how the backup was made.


----------



## unixlearn (Jan 6, 2014)

If you have a lot of ports and packages installed, i.e. GNOME or KDE, then you will have a lot of issues trying to upgrade. You will actually save more time by just backing up your files and doing a clean install all over again. So much has changed between FreeBSD 8.1 and FreeBSD 8.4. I know you can avoid it, but there is going to be a lot of troubleshooting if you try to just upgrade in a vacuum.


----------



## hockey97 (Jan 6, 2014)

unixlearn said:
			
		

> If you have a lot of ports and packages installed, i.e. GNOME or KDE, then you will have a lot of issues trying to upgrade. You will actually save more time by just backing up your files and doing a clean install all over again. So much has changed between FreeBSD 8.1 and FreeBSD 8.4. I know you can avoid it, but there is going to be a lot of troubleshooting if you try to just upgrade in a vacuum.



Too late. I already upgraded and it went well but then I upgraded PHP and it detected Perl to be outdated so it also updated that too and then everything broke. I now cannot get into bash or another shell. My server cannot boot. Is there anything online I can download and boot off of? I have a 500 gb GB external hard drive. I want to know if I can use something just to access my hard drive and back[]up *A*pache and other server config_uration_ files? Any suggestions? I just need to boot off something enough so I can look into my hard drive and grab all the config_uration_ files. I did do a backup but tried to restore it amd found out the dump was bad. So, I need to get back in and try and grab the config_uration_ files. I use Apache 2.2,  PHP5.3.2  and My_SQL_ 5.5,  and Postfix and Dovecot. I need to back up those config_uration_ files.


----------



## hockey97 (Jan 6, 2014)

wblock@ said:
			
		

> The output of bzcat(1) would have to be piped into some other program, possibly restore(8).  That type of thing is best tested before it's needed.  It's not clear where the advice to use that appeared, or how the backup was made.


 I got the advice from this user:  http://daemonforums.org/showthread.php?t=2238

He owns his own forums and is a member on here. However, I read his thread on here which is the same _as_ what he posted on his website. I followed that word for word.


----------



## Terry_Kennedy (Jan 7, 2014)

hockey97 said:
			
		

> s there anything online I can download and boot off of? I have a 500 gb GB external hard drive. I want to know if I can use something just to access my hard drive and backup Apache and other server configuration files? Any suggestions?


Sure. You could download a bootable image (*-disc1.iso if you have a CD drive, *-dvd1.iso if you have a DVD or Blu-ray drive, or *-memstick.img if you're using a USB flash drive) from here. Regardless of which media type you use, boot it (you may need to either change the boot order in your BIOS or override it if your BIOS has a boot selection key - normally F10, F11 or F12). Tell it which locale you're in and then select the "Fixit" menu item. That will take you to a shell where you can mount your disk partitions and copy any settings over. If you need network access (for example, to FTP the files to a different system), select "Configure - post-install tasks" from the menu and then select "Networking" to set up your network parameters, then use Fixit to get a shell to back up your files.



> I just need to boot off something enough so I can look into my hard drive and grab all the configuration files. I did do a backup but tried to restore it amd found out the dump was bad. So, I need to get back in and try and grab the configuration files.


Unless you're regularly tracking the relevant -STABLE branch (8-STABLE in your case), upgrading can be a bit of work. Definitely in the case of a major version change (for example, 8.x to 9.x) and often in the case of a minor version change (8.x to 8.y), it is easier to do a clean install of the system and packages/ports you need, then copy your configuration files over and carefully merge those changes in. The first time you do this, it will probably be a pain because your programs and data are mingled with the distribution ones. Careful organization of things will make this easier if you have to do it again in the future. 

The reason for the re-install is twofold - first, if you upgrade, you'll have some programs which link against older libraries, and some which link against newer ones. Aside from taking up extra space, you can run into problems when linking programs. The second is that there's a lot of "behind the scenes" stuff going on in ports, and unless you read all of /usr/ports/UPDATING very carefully, you can get into situations like the one you found yourself in. Some recent cases in point - the db* ports, PHP default version changes, Perl updates, and (going back a bit further) glib20 and readline changes.


----------



## hockey97 (Jan 7, 2014)

Terry_Kennedy said:
			
		

> hockey97 said:
> 
> 
> 
> ...



Ok, but for now what should I do?  I have a server that I can't even run in terminal. It boots into errors. Is there anything I can use that will boot tools that will allow me to backup the configuration files of *A*pache, *M*y*SQL* etc.?  I just need to backup the configuration files that deal with setting up *A*pache, *P*ostfix, davcot Dovecot _(presumably -- mod.)_, *M*y*SQL* etc.  It took me two months in total to configure everything and get it working properly.  I already have multiple backups  but all the backups have the configuration files corrupted. 

So, I need to find a way to save the configuration files before I do a clean new install. Once I do that I need to figure out what to upgrade to? what version I should upgrade to?

However, before all this I need to ask the question: how do many websites/ servers do admins deal with when upgrading? Let's say those companies that offer web hosting services. How are they able to do upgrades quickly? For instance my *u*niversity takes two days to do upgrades for their servers. They usually always end on time.  How do these organizations upgrade or do clean installs for the new OS and update the software in two days? 

I myself config_ure_ and set[ ]up my servers with additional features like SSL etc. and I notice it takes you at least two months to config_ure_ everything and get it to work properly. Well at least for me and it's because I don't have weeks to focus on the server. I attend a *u*niversity and have other obligations where I don't focus my time 100% on servers.  If I did that or had the time. I am sure I could get it to a month or maybe three weeks at least.  However, major organizations usually take two days.

I myself did talk to many of them and they told me that they do swipe outs. They have backup systems in place and do a manual backup. Then they install the new OS which takes a few hours. Then they run a script that grabs all configuration files for all the server software and would either replace or update the new configuration files.  This is how they are able to do this in two days.

Is this the legit way? What do hosting service providers do when upgrading systems?


----------



## Terry_Kennedy (Jan 8, 2014)

hockey97 said:
			
		

> Ok, but for now what should I do?  I have a server that I can't even run in terminal. It boots into errors. Is there anything I can use that will boot tools that will allow me to backup the config files of apache, mysql etc?  I just need to backup the config files that deals with setting up apache, postfix, davcot, mysql etc.  It took me 2 months in total to config everything and get it working properly.  I already have multiple backups  but all the back ups have the config files corrupted.


If you download and boot one of the images I linked in my post, you'll be running from the CD (or USB drive) - you don't need to have any type of working system. You should then be able to mount the disk partition(s) on the non-working system, using the CD/USB drive, and copy your data over.



> So, I need to find a way to save the config files before I do a clean new install. Once I do that I need to figure out what to upgrade too? what version I should upgrade too?


You won't need to upgrade right away - you'll be running the newest release of whatever version you install. For a production system, 9.x is probably your best bet right now (10.0 is too new). 8.x might be better if that's the version you're used to (I'm running 8.4 here).



> However, before all this I need to ask the question is how do many websites / server admin deal with upgrading?
> 
> How, does these organizations upgrade or do clean installs for the new OS and update the software in 2 days?


Often, via a (sometimes virtual) "forklift upgrade" - get the base system and whatever ports / packages are needed running and configured on a new server / new VM, then when everything has been tested, copy the user data over. That's where having a clean separation of "user stuff" and "system stuff" comes into play - it's a lot easier to back up an entire directory tree and restore it on the new box, rather than having to look at each file individually. It helps to have a formal plan in place, to keep track of what needs to be done and in what order. Here's a lightly-sanitized version of a file called "the big plan.txt" from a recent upgrade here:


```
The Big Plan (X = done, o = pending):

X Changes to web sites need to be frozen and the contents of all of the stuff on old-box
  copied to new-box.

X virtualhost (old-box) and new-virtualhost (new-box) swap IP addresses, flash-cutting all
  web services except www.example.com, box.example.com and samplesite / samplesite2 to
  the new system. Requires changes to rc.conf (and reboots) on both, and (probably) changes
  to the httpd virtualhost config on both.

X www (old-box) and new-www (new-box) do the same, via the same method.

X Any changes necessary for new-box to take over as box need to be made (virtusertable,
  access, etc. on new-box; remote mounts of /usr/local/src and /sysprog on all other box-
  es, and so on). Also, httpd.conf on old-box / httpd-vhost.conf on new-box need to be
  told the new hostnames.

X old-box and new-box swap primary IP addresses, and .226 gets renamed to "old-box" in
  DNS. Re-mount remote mounts of /usr/local/src and /sysprog (using box instead of new-
  box in fstab). Remote management addresses (oob.box, oob.new-box) swap and one gets
  renamed to "oob.old-box" in DNS. Note that as part of this, oob.box is renumbering
  from .4 to .48

  At this point new-box is effectively box and the only thing running on old-box is the
  samplesite / samplesite2 web page.

X edit the backup scripts on old- and new-box to have the correct hostname in both the
  script name / cronjob and the name of the dumpfile. Rename the existing backup dumpfiles
  so that they reflect the new reality.

X Reconfigure old-box to not run named (rc.conf / resolv.conf).

X Go through DNS configs and get rid of all old-*/new-* stuff EXCEPT old-virtualhost and
  clean up any other stuff in DNS labeled "TODO".

X Deconfigure all un-necessary services (nfs, shell, ftp, yadda, yadda) on old-box.

X Remove almost all of /var/www except for what's needed to run the samplesite stuff and
  to say "you're digging in the wrong place" when trying to access the main server.

X Move old-box /usr/local/src into /var/tmp/old-local-src

X Remove alias IP address for old-www (but NOT old-virtualhost) from old-box.

X Prune httpd configuration on old-box to remove all but samplesite / samplesite2, delete
  SSL keys, no-longer-needed rewrites / access, etc. and restart.

X Clean up httpd.conf and children on both old-box and new-box

X Migrate old-* to new subnet allocated by Bob

X Get rid of 234.168.192.in-addr.arpa (DRAC3/XT stuff) and matching forward (example.com)
  references to those addresses

X Remove the old-* stuff from DNS.

o [Eventually] Hand HJ the old-box box and a check and tell him it's time that server
  gets a job and moves out.
```

Note that this was a bit more complex than what you'll be doing, as one set of web sites (samplesite/samplesite2 in my plan) were staying on the old system, since it was being handed to a user who is going to move it to another hosting facility.


----------



## hockey97 (Jan 8, 2014)

Ya Yeah, but the only thing I have is an external hard drive via _USB_, the WD My Book 500gb 500 GB. That is the only thing I have on hand. I cannot burn a blank CD. 

I already tried using YUMI to make an installer bootable from the _DVD_ images. I don't know what I need to do to get a mem*ory* image to work. I just put the image on my external hard drive and nothing happened at bootup. It wasn't detected. 

When I tried YUMI it said that there's no configuration file and ends in error. My Ubuntu Serve image I downloaded works perfectly. So, how would I use the images to get it to boot off the external hard drive?


----------



## Terry_Kennedy (Jan 8, 2014)

hockey97 said:
			
		

> Ya, but the only thing I have is a  external hard drive via usb. The WD My Book 500gb. That is the only thing I have on hand. I cannot burn a blank CD.


You don't have a USB memory stick somewhere? The 8.4 memstick images are well under 2 GB, so just about any should work.



> I already tried using Yumi to make a installer bootable from the dvd images.


I don't know what YUMI is. From the name, I'd guess something from Linux, which may not understand FreeBSD booting (once you get past the initial boot block, things diverge on different operating systems).



> I don't know what I need to do to get a mem image to work. I just put the image on my external hard drive and nothing happened at bootup. It wasn't detected.


Hard disks need hard disk boot blocks. CD's need ISO 9660 (or UDF, etc.) boot blocks. Memory sticks also have their own style. So you can't freely move the image from one type of media to another. In a perfect world, this wouldn't have happened, but that's the way the original PC BIOS design grew. UEFI claims to have generic boot blocks (or, more accurately, copies of each type of boot block on the media, no matter what the media type is). But UEFI has its own issues.


----------



## wblock@ (Jan 8, 2014)

The memstick image is a disk image.  YUMI is a kind of neat program that will take CD images and let you combine them on a memory stick along with automatically generating a menu.  Last I looked, it does not have an entry for FreeBSD.  It might work with the generic CD-based tools, but the FreeBSD memory stick images are already available for download directly.


----------

