# HOWTO: Convert from RELEASE to STABLE



## youngunix (Oct 26, 2013)

*HOWTO: Convert FreeBSD 9-RELEASE to 9-STABLE (can be used with FreeBSD 8)*

*WARNING:* Backup, backup, backup! Did I say it enough times?!

1. Update your current 9-RELEASE

`# freebsd-update fetch && freebsd-update install`

2. Install Subversion if you haven't already:

    + Using ports:
`# cd /usr/ports/devel/subversion`
`# make install clean`

    +If the ports tree is not available, Subversion can be installed as a package:
`# pkg_add -r subversion`

    +If pkgng is being used to manage packages, Subversion can be installed with it instead:
`# pkg install devel/subversion`

3. Move,  rename, or delete the existing /usr/ports and /usr/src:

`# mv /usr/ports /usr/ports.bak`
   OR
`# rm -rf /usr/ports/*`
   AND
`# mv /usr/src /usr/src.bak`
   OR
`# rm -rf /usr/src/*`

4. Checkout:

`# svn checkout [URL]https://svn0.us-west.FreeBSD.org/base/stable/9/[/URL] /usr/src`
`# svn checkout [URL]https://svn0.us-west.FreeBSD.org/ports/head[/URL] /usr/ports`

5. Update:

`# svn up /usr/src`
`# svn up /usr/ports`

6. Rebuild and install world and kernel:

`# cd /usr/src`
`# make buildworld`
`# make buildkernel`
`# make installkernel`
`# shutdown -r now`
--------------------------------------------------------------
At the boot option screen, choose #2 (single user) then:
   +If using UFS:
`# mount -u /`
`# mount -a -t ufs`

   +If using ZFS:
`# zfs set readonly=off zroot`
`# zfs mount -a`

   +Then:
`# adjkerntz -i`
`# mergemaster -p`
`# cd /usr/src`
`# make installworld`
`# mergemaster -UiF`
`# yes | make delete-old`
`# yes | make delete-old-libs`
`# cd /usr/obj && chflags -R noschg * && rm -rf *`
`# reboot`
--------------------------------------------------------------
+If using UFS:
`[S]# mount -u /[/S]`
`[S]# mount -a -t ufs[/S]`

   +If using ZFS:
`[S]# zfs set readonly=off zroot[/S]`
`[S]# zfs mount -a[/S]`

`[S]# make delete-old-libs[/S]`
`[S]# reboot[/S]`
--------------------------------------------------------------
7. Add your GPU driver to loader.conf (in my case: nvidia):

`# vi /etc/default/loader.conf` (and add nvidia_load="YES")
   OR
`# vi /etc/loader.conf`
`# reboot`

8. Check your installation:

`# uname -a`

*NOTE:* Don't use freebsd-update, it only works with RELEASE.

*Suggestions* by @wblock@:





> I suggest using -Ui with mergemaster(8). After the first run, it saves a lot of time. Also, it's not a bad idea to set it to skip over /etc/master.passwd in /etc/mergemaster.rc:
> 
> ```
> IGNORE_FILES='/etc/master.passwd'
> ...


----------



## kpa (Oct 26, 2013)

Slight nitpick. I always do `adjkerntz -i` before remounting the root filesystem in read/write mode. This is because I want to be sure that any timestamps that are possibly written on the filesystems are correct.

Also, you can do `make delete-old-libs` right after `make delete-old` without rebooting in between, the end result is the same.


----------



## wblock@ (Oct 26, 2013)

Step 1, using freebsd-update(8), is not necessary.

I suggest using -Ui with mergemaster(8).  After the first run, it saves a lot of time.  Also, it's not a bad idea to set it to skip over /etc/master.passwd in /etc/mergemaster.rc:

```
IGNORE_FILES='/etc/master.passwd'
```

This will cause surprises when new default users are added, like the auditdistd user recently, but it's better than the surprise of accidentally overwriting all the user passwords.


----------



## youngunix (Oct 26, 2013)

@kpa: I try to keep it noob proof and basic and according to the results I got, which is a perfectly working environment. However, if anyone would like to try it that way, they are welcome to.
@wblock@: I used freebsd-update(8) for the "Just-In-Case" purpose. It can be ignored if one chooses to do so.
As for the suggestions, they can be very usefull, adding them now.


----------



## priyadarshan (Nov 24, 2014)

Would this be still a valid way to convert from 10.1-RELEASE to 10-STABLE?


----------



## wblock@ (Nov 24, 2014)

Yes, with the appropriate changes to the checkout branch names.  The short version is "check out the stable branch, build from source, and install".


----------

