Koozali.org: home of the SME Server

Obsolete Releases => SME Server 8.x => Topic started by: ElFroggio on July 04, 2014, 06:13:37 PM

Title: Rename ibay
Post by: ElFroggio on July 04, 2014, 06:13:37 PM
Hi,

I use SME8.1. Is there a simple way of renaming an ibay?

Thanks

Syv
Title: Re: Rename ibay
Post by: CharlieBrady on July 04, 2014, 07:02:57 PM
Only way I know is to create a new i-bay with same properties as the existing one, copy all files from the i-bay share, then delete the existing one.

It's up to you whether you call that 'simple' or not :-)
Title: Re: Rename ibay
Post by: mmccarn on July 05, 2014, 01:39:33 PM
Here's a step-by-step to rename "oldibay" to "newibay"

1) Create newibay in server-manager

2) Open a shell as root and rename the ibay folders
  # cd /home/e-smith/files/ibays
  # mv newibay newibay-xxx
  # mv oldibay newibay
  # mv newibay-xxx oldibay


3) View the account settings for each ibay and set the new ibay to match the old ibay
  # db accounts show oldibay
  # db accounts show newibay

Now, for each item in the output EXCEPT Uid and Gid, set newibay to match the setting from oldibay

This code block *might* take care of this for you:
Code: [Select]
OLDIBAY=oldibay
NEWIBAY=newibay
#
# List the db variables to check
DBVARS="AllowOverride CgiBin FollowSymLinks Group PublicAccess UserAccess PHPBaseDir Name"
#
# set the db variable in $NEWIBAY *only* if it exists in $OLDIBAY
for dbvar in $DBVARS; do db accounts getprop $OLDIBAY $dbvar && db accounts setprop $NEWIBAY $dbvar "`db accounts getprop $OLDIBAY $dbvar`"; done

4) Activate the changes (if any) from step 3 and fix the permissions on newibay
  # signal-event ibay-modify newibay

5) TEST THE NEW IBAY

6) If the new ibay works and serves your desired content, delete the old ibay from within server-manager (this step gives an error if there isn't a folder for server-manager to delete, hence the 3rd "mv" command in step 2).