Koozali.org: home of the SME Server

Upgrading vs new install + restore

at9

hm...
« Reply #45 on: August 24, 2006, 12:31:03 PM »
I take first backup and now all ok. Propably my next backup was wrong. Now all is ok. I don[t understand that but...i hope my work is finish:)

Offline netspirit

  • 14
  • +0/-0
    • http://www.om-conseil.com
Upgrading vs new install + restore
« Reply #46 on: September 18, 2006, 04:32:11 PM »
Hi at9,

Did you find a solution for MySQL problems during upgrade from 6.0.1 to 7.0?  I'm facing same problem.
Thanks.
...
Nous ne savons pas le vrai si nous ne savons la cause - PLATON
www.om-conseil.com

Offline chris burnat

  • ****
  • 1,135
  • +2/-0
    • http://www.burnat.com
Upgrading vs new install + restore
« Reply #47 on: September 18, 2006, 04:40:47 PM »
Edited, please see next entry.
- chris
If it does not work out of the box, please fill in a Bug Report @ Bugzilla (http://bugs.contribs.org)  - check: http://wiki.contribs.org/Bugzilla_Help .  Thanks.

Offline chris burnat

  • ****
  • 1,135
  • +2/-0
    • http://www.burnat.com
Upgrading vs new install + restore
« Reply #48 on: September 18, 2006, 04:45:04 PM »
Quote from: "burnat"
Quote
Did you find a solution for MySQL problems during upgrade from 6.0.1 to 7.0? I'm facing same problem.

Quote
Prior to removing the old drive, remember to run a pre-backup to dump mysql db" Refer Ray Mitchell's post  22 Aug 2006 19:35    Post subject: Re: Restoring MySQL. further up this thread.  Also check:
http://bugs.contribs.org/show_bug.cgi?id=615

I think what is required is:

Before and after the restore you will need to run some SME commands
signal-event pre-restore
-> restore files
signal-event post-upgrade
signal-event reboot

Ray, can you confirm?

Hope it helps.
- chris
If it does not work out of the box, please fill in a Bug Report @ Bugzilla (http://bugs.contribs.org)  - check: http://wiki.contribs.org/Bugzilla_Help .  Thanks.

Offline raem

  • *
  • 3,972
  • +4/-0
Upgrading vs new install + restore
« Reply #49 on: September 19, 2006, 12:18:54 AM »
burnat & others

Edited to include pre-backup event on old sme6 before shutdown - 24/9/06

> Before and after the restore you will need to run some SME commands
> signal-event pre-restore
> Ray, can you confirm?

Here is a mini howto that someone wrote which I luckily copied & saved. This post & others went missing in the recent "disappearing posts" event.

Question:
have Installed a clean v7.0 on a new server, and after removing
custom templates and add ins to the best of my ability, used the
copyfromdisk method to copy the OLD sme 6.01 data to the new server.

Answer:
If I understand you correctly, you may not have followed the recipe
correctly when upgrading your server. You should cleanup your custom
templates (templates-custom and templates-user-custom to be precise) AFTER
restoring your data from the old vs6 drive. Check steps 10 to 14 below, and
follow them stricly. Removing custom-templates before restore of old data
from your VS6 drive achieves nothing - just check relevant directories and
see what is there, probably some templates from the old VS6 drive, and
possibly your problem. Hope it helps.


1. On the old sme6 server prior to shutting down do
/sbin/e-smith/signal-event pre-backup
then shutdown & remove the drive
2. On the new machine do a fresh install of sme7.0 OS
3. Shut down & install old 6.0 drive and start machine.
4. cd /
5. mkdir /mnt/tmp
6. mount /dev/hdb2 /mnt/tmp (adjust "hdb2" according to where the 6.0 drive
is installed).
7. /sbin/e-smith/db configuration setprop backup Program CopyFromDisk status
enabled
8. /sbin/e-smith/signal-event pre-restore
9. /sbin/e-smith/signal-event restore-tape /mnt/tmp
(note: this step may take a long time depending on how much data is being
restored)
10. cd /etc/e-smith
11. mv templates-custom templates-custom.old
12. mkdir templates-custom
13. mv templates-user-custom templates-user-custom.old
14. mkdir templates-user-custom
15. /sbin/e-smith/signal-event post-upgrade
16. /sbin/e-smith/signal-event reboot
17. Shutdown and remove old sme6 drive
...

Offline raem

  • *
  • 3,972
  • +4/-0
Upgrading vs new install + restore
« Reply #50 on: September 19, 2006, 02:32:53 AM »
To all

One other issue that is probably worth including in this thread, is that of the different partitions in sme7 compared to sme6.
An upgrade install from CD on a existing sme6 will not change the partitions to the new sme7 format (sme6 has 3 partitions, sme7 has 2 partitions). There are other forum posts & bug tracker entries that refer to this eg
http://bugs.contribs.org/show_bug.cgi?id=572

The effect of this is that an upgraded sme6 retains the old partitions and the "very nice" feature in the admin console panel to add a drive to a broken software RAID1 array WILL NOT work.

I believe the developers plan to fix this in a later release of sme7 (7.1 ?) so that the partitions are automatically converted during an upgrade, but no guarantees here.

The workaround (particularly if you want to avail of this new feature to easily rebuild a software RAID1 array in sme7), is to do a fresh install of sme7 either with one or two disks, as software RAID1 will be configured by default (degraded mode for one disk installs).
Then you can restore from your sme6 backup using one of the methods described, or just even manually reconfigure the new server from scratch.
...

Offline raem

  • *
  • 3,972
  • +4/-0
Upgrading vs new install + restore
« Reply #51 on: September 23, 2006, 09:17:31 PM »
burnat & others

> Prior to removing the old drive, remember to run a pre-backup to dump mysql db

Yes, I think the step people are overlooking to do is:

On the old sme6 server prior to shutting down do:
/sbin/e-smith/signal-event pre-backup

then shutdown & remove the drive and transfer it to the newly built & installed sme7 server
Then follow the instructions for mounting the drive & restoring etc etc.

I have edited the steps posted earlier
...

Offline Smitro

  • *
  • 349
  • +0/-0
Upgrading vs new install + restore
« Reply #52 on: September 24, 2006, 09:10:29 AM »
Hi all,

I'm going to upgrade my server this Friday. It's currently holding about 50gb of data. SME 6.5 serving Websites / Email / and a couple of SMB shares.

It seems that no one has suggested this method it seemed like the easiest one to me... but there could be some major faults in it.

- Backup using Backup2ws (911 Disaster Recovery)
- Wipe Drive
- Install SME 7.0
- Install Backup2ws
- Restore backup from 6.5 (listed in first step)

Then I'm not sure if I still have to rename the custom templates folder. (I'm not sure if it's in the 911 Disaster Recovery backup)

Does this sound like it will work? Anyone tried it? Is the folder stucture much different in SME 7?
.........

Offline raem

  • *
  • 3,972
  • +4/-0
Upgrading vs new install + restore
« Reply #53 on: September 24, 2006, 09:50:59 AM »
Smitro

> It seems that no one has suggested this method...backup2ws

It is a long established way of backup & restore ever since Darrell released the contrib (2 or 3 years ago now).


> It's currently holding about 50gb of data.

Keep in mind it will take you many hours to back that up and many more hours to restore that amount of data, enjoy the wait.


> - Backup using Backup2ws (911 Disaster Recovery)
> - Wipe Drive
> - Install SME 7.0
> - Install Backup2ws
> - Restore backup from 6.5 (listed in first step)

> Then I'm not sure if I still have to rename the custom templates folder. > (I'm not sure if it's in the 911 Disaster Recovery backup)

The custom templates are in the 911 backup as is everything else (data & config) that is changeable on the sme6 server.
You are going to have the same issues, you will need to remove all the custom templates and configuration changes that any sme6 contribs have made, as these will clash with sme7.

You also have the unreversable situation of having completely wiped your sme6 before establishing that your sme7 will be working correctly after the restore. You don't have a fallback if things go wrong, which they likely will with the procedure you have outlined.

The safer way would be to uninstall all contribs & add ons & remove custom templates and get your sme6.x back to standard.

Then just do a upgrade to sme7 directly, or if you want a "clean" system do a backup of sme6.x, and restore on new sme7.

If you can find a spare hard drive then it may be easier to do the restore from disk method outlined earlier in this thread (4 posts back) as it effectively removes the backup step & saves a few hours.

Whichever method you use you cannot avoid removing the contribs & data & config & templates that will clash with sme7.
...

Offline Smitro

  • *
  • 349
  • +0/-0
Upgrading vs new install + restore
« Reply #54 on: September 26, 2006, 01:13:37 AM »
RayMitchell, as always you you've been very helpful, and I see where you are coming from.

At the moment there is a 120gb drive in the machine. I have a spare 200gb drive. But I don't want to make the 200gb drive the permanent drive. (I know part of me is sayinging I'm going to regret this). I'd like to stay with the 120gb because it's proven to be more than enough over the last year and a bit that I've been running the server. The reason I purchaced a was so I could hold a couple of backups on it.

My question is... can I use the 200gb drive to aid this process.

I think there is a program that comes with knoppix that will alow me to image the drive. So I think I'll image across everything onto the 200gb drive.. make sure its 100% then do as you said, wipe the 120gb drive, then install SME 7.0 and follow on with the process.

Is there an easier way of doing this? and is there any better programs for duplicating drives that you would recommend?
.........

Offline Smitro

  • *
  • 349
  • +0/-0
Upgrading vs new install + restore
« Reply #55 on: October 02, 2006, 01:00:27 PM »
Hey, I thought I better let you know my findings.

I had a SME 6.5 server that I just upgraded. I used a program called "Roadkil's Raw Copy" (http://www.roadkil.net/diskutils.html) to duplicate the 2 disks (this process took 4 hours). So I had 2 exact copies of my origonal server. I booted the second drive made sure it worked, got it ready for copying from (as mentioned in step one above). I wiped the hard drive that I wanted to use for my server. and followed your instructions exact to the end. And it worked a treat. Now I'm just going through and trying to find all the new version of the contribs I used in the past.

Thanks once again.
.........

Offline byte

  • *
  • 2,183
  • +2/-0
Upgrading vs new install + restore
« Reply #56 on: October 03, 2006, 04:08:44 PM »
Quote from: "RayMitchell"


> It's currently holding about 50gb of data.

Keep in mind it will take you many hours to back that up and many more hours to restore that amount of data, enjoy the wait.


Think that's bad I've got to do an upgrade shortly with about 200GB of data  :roll:
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline dmay

  • *
  • 450
  • +0/-0
    • http://myezserver.com
Upgrading vs new install + restore
« Reply #57 on: October 09, 2006, 05:18:28 AM »
I just upgraded a server from SME 5.5 to SME 7. Here are the basic steps I followed:

1) make a current backup

2) list all installed rpms:

# rpm -qa | sort > /root/rpmlist

3) view the above list and remove all contrib rpms:

# rpm -e blah

4) rename templates-custom and templates-user-custom

 # mv /etc/e-smith/templates-custom /etc/e-smith/templates-custom.55
 # mv /etc/e-smith/templates-user-custom /etc/e-smith/templates-user-custom.55

5) upgrade to SME 6.0
6) test and make a current backup

7) upgrade to SME 7.0
8) test and make a current backup

9) add 7.0 contribs

Darrell

Offline elmarconi

  • ***
  • 139
  • +0/-0
Upgrading vs new install + restore
« Reply #58 on: November 14, 2006, 07:35:57 PM »
Quote from: "RayMitchell"

1. On the old sme6 server prior to shutting down do "/sbin/e-smith/signal-event pre-backup" then shutdown & remove the drive
2. On the new machine do a fresh install of sme7.0 OS
3. Shut down & install old 6.0 drive and start machine.
4. cd /
5. mkdir /mnt/tmp
6. mount /dev/hdb2 /mnt/tmp (adjust "hdb2" according to where the 6.0 drive
is installed).
7. /sbin/e-smith/db configuration setprop backup Program CopyFromDisk status
enabled
8. /sbin/e-smith/signal-event pre-restore
9. /sbin/e-smith/signal-event restore-tape /mnt/tmp
(note: this step may take a long time depending on how much data is being
restored)
10. cd /etc/e-smith
11. mv templates-custom templates-custom.old
12. mkdir templates-custom
13. mv templates-user-custom templates-user-custom.old
14. mkdir templates-user-custom
15. /sbin/e-smith/signal-event post-upgrade
16. /sbin/e-smith/signal-event reboot
17. Shutdown and remove old sme6 drive


Well, I found sort of similar approach: Other than mounting the harddrive in step6 I just mounted the latest rsnapshot.hourly whole old disk off the running server thru NFS. Someting to remember is to export as ro,no_root_squash otherwise things will blow up in your face.
I had forgotten one thing, as to remove the one and only testuser on the new SME7, being me myself and I, which I used for preliminairy testing, resulting in a lot of files with missing uid and groupid. Again relatively easy to fix by applying:
find /home/e-smith/files/ -nouser -print0 | xargs -0 chown memyselfandi
find /home/e-smith/files/ -nogroup -print0 | xargs -0 chgrp memyselfandi

Other than that I did not notice any abnormalities yet. Keep you posted.
...

Offline geoff

  • **
  • 61
  • +0/-0
Upgrading vs new install + restore
« Reply #59 on: November 15, 2006, 09:44:43 PM »
Quote from: "RayMitchell"
burnat & others

1. On the old sme6 server prior to shutting down do
/sbin/e-smith/signal-event pre-backup
then shutdown & remove the drive
2. On the new machine do a fresh install of sme7.0 OS
3. Shut down & install old 6.0 drive and start machine.
4. cd /
5. mkdir /mnt/tmp
6. mount /dev/hdb2 /mnt/tmp (adjust "hdb2" according to where the 6.0 drive
is installed).
7. /sbin/e-smith/db configuration setprop backup Program CopyFromDisk status
enabled
8. /sbin/e-smith/signal-event pre-restore
9. /sbin/e-smith/signal-event restore-tape /mnt/tmp
(note: this step may take a long time depending on how much data is being
restored)
10. cd /etc/e-smith
11. mv templates-custom templates-custom.old
12. mkdir templates-custom
13. mv templates-user-custom templates-user-custom.old
14. mkdir templates-user-custom
15. /sbin/e-smith/signal-event post-upgrade
16. /sbin/e-smith/signal-event reboot
17. Shutdown and remove old sme6 drive


Huge thanks to everyone who worked on this - an excellent solution which worked almost perfectly several times over the last week or so.

"Almost" perfectly because "hdb2" on SME 6.0 is surely swapfile space? (See #6 above)

Once changed to hdb3 this "HowTo" worked flawlessly.

Thanks to all who worked on SME 7 and HowTos like this one for great work.
 :D