Changes

From Amahi Wiki
Jump to: navigation, search
13,590 bytes added ,  22:00, 16 August 2014
Created page with "<p>The purpose of this tutorial is to provide a method for migrating Amahi HDA settings from one Amahi supported OS to another (i.e. [https://wiki.amahi.org/index.php/Ubuntu U..."
<p>The purpose of this tutorial is to provide a method for migrating Amahi HDA settings from one Amahi supported OS to another (i.e. [https://wiki.amahi.org/index.php/Ubuntu Ubuntu 12.04.x] to [https://wiki.amahi.org/index.php/Fedora_19 Fedora 19]). Although this will be a manual process, there is a script provided to capture most of the settings you will need for the new Amahi HDA. Hopefully this will make it a more manageable task than in the past.</p>

<p>Please understand this is a guide to assist you in the migration. There is no guarantee this guidance will work for everyone. While every effort has been taken to accurately document the migration steps, use at your own risk.</p>

<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #FFB6C1; margin: 3px 3px 1em 3px;">'''IMPORTANT:''' You will need to document any manual configuration changes or apps installed from sources other than the [https://www.amahi.org/apps Amahi App Store].</div>

== Backup Settings ==
<p>As with any other migration process, you will need to back up your HDA settings. In order to make the new system look and feel like your current one, there are certain components we need to capture.</p>

<p>To make this as painless as possible, a script is being provided. Once you run the script, it will record all the important information such as users, shares, apps installed, network, and Greyhole settings (if installed) in a text file. You can then copy that file to a safe location for use once the new system is ready to be configured.</p>

[https://wiki.amahi.org/index.php/Open_Terminal_as_root As root user], do the following:
* Navigate to the root directory:
cd /root
* Download ''hda_migration.sh'' script (sha1sum: 14281005c1263105862f5fe0bb1825963f330a53):
wget <nowiki>https://dl.dropboxusercontent.com/u/1380867/hda_migration.sh</nowiki>
* Make it executable:
chmod 755 hda_migration.sh
* Run the script:
./hda_migration.sh

If all goes well, you will see a message similar to the one below:
<pre>
HDA Settings Backup Complete!
Filename : hda_production_migration.txt
Directory: /root
</pre>
Copy '''hda_production_migration.txt''' (hereon referred to as ''migration text'') to another machine and view the contents. Ensure all your settings were accurately captured before proceeding to the next section. Also see [[HDA_OS_Migration#Additional Tips|Additional Tips]] below for optional steps you may want to complete.

== Greyhole Cleanup ==
If you are not currently using [https://wiki.amahi.org/index.php/Greyhole Greyhole], you can '''SKIP''' this section.

Otherwise, [https://wiki.amahi.org/index.php/Open_Terminal_as_root As root user], begin with emptying the trash:
greyhole -a
Also recommend you run a <code>fsck</code> to ensure all files are in place:
greyhole -f
Monitor activity via the log file:
tail -f /var/log/greyhole.log
Once it's complete, you can prepare to shutdown your system

== Shutdown Preparation ==
Before powering '''OFF''' the HDA, you need to:
# Turn '''OFF''' DHCP server on the HDA
# Turn '''ON''' your [https://wiki.amahi.org/index.php/Turning_off_DHCP_in_your_router router DHCP/DNS server]
# Power '''OFF''' any clients that aren't needed
# [https://wiki.amahi.org/index.php/RenewIP Renew DHCP lease] for clients to remain '''ON'''
# Verify all clients have connectivity via the router
# Download new [http://docs.amahi.org Amahi install image]

Once you have the media ready for install, it's time to power '''OFF''' your HDA.

[https://wiki.amahi.org/index.php/Open_Terminal_as_root As root user], execute:
:<pre>shutdown now -P</pre>
:or
:you can select the '''Shutdown''' icon (the '''<span style="color:red">RED</span>''' one) from the HDA Dashboard ''Settings'' tab.

Once the HDA is '''OFF''', disconnect all hard drives except the one for the OS. You don't need to remove them, just disconnect the power and drive cables.

== New Installation ==
To begin:
* Power '''ON''' your HDA
* Insert installation media (reboot if needed)
* Follow the appropriate [http://docs.amahi.org Amahi installation instructions]
* Once complete, '''DO NOT''' disable the router DHCP/DNS server yet.

== Validate Success ==
Once the install is complete, you need to validate the install was successful. Ensure everything is working correctly before proceeding to the next section.

What you should check:
* Does the HDA boot successfully and without errors
* Can you connect to the Amahi Dashboard (<nowiki>http://hda</nowiki> or by IP Address)
* Does the HDA have internet connectivity (try <code>yum list hda-platform</code>)

If you have problems, refer to the [https://wiki.amahi.org/index.php/Network_troubleshooting Network Troubleshooting] guide in the wiki.

Once everything appears to be working, you can now disable your [https://wiki.amahi.org/index.php/Turning_off_DHCP_in_your_router router DHCP/DNS server]. The Amahi HDA will become your DHCP/DNS server for the network.

<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">'''NOTE::''' You will need to [https://wiki.amahi.org/index.php/RenewIP renew the DHCP lease] on any client systems currently connected to the network.</div>

== Configure Drives ==
If you do not have any additional drives to connect to your HDA, you can '''SKIP''' this section.

Otherwise, you will need to:
* Power '''OFF''' the HDA
* Reconnect the power and drive cables
* Power '''ON''' the HDA

[https://wiki.amahi.org/index.php/Open_Terminal_as_root As root user], edit ''/etc/fstab'':
vi /etc/fstab
* Append entries the end of the file as noted in the '''fstab''' section of the ''migration text''. For example:
:<pre>UUID=b7017251-cb54-438b-92a3-781537c565e6 /var/hda/files/drives/sdb ext4 defaults 1 2 noatime,data=writeback,nofail</pre>
* Ensure you '''DO NOT''' add any drive lines that contain ''/'', ''/boot'', or ''swap''. For example:
:<pre>UUID=1ebbf241-528c-465e-889f-acc15400dd8c / ext4 defaults 1 1</pre>
* Create directories that correspond the the path in the drive lines. For example:
:<pre>mkdir -p /var/hda/files/drives/sdb</pre>
:indicates a drive listed in ''/etc/fstab'' will be mounted at this location.

Once you have all the drives added to ''/etc/fstab'' and the directories created, you can then mount the drives.
mount -a
If there are any errors, compare with the '''fstab''' section of the ''migration text''. '''DO NOT''' proceed to the next section until all drives are correctly mounted.

== Install Applications ==

<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #FFB6C1; margin: 3px 3px 1em 3px;">'''WARNING:''' Some applications may not be ''LIVE'' for the new Amahi supported OS. Also the application version could be newer than you had installed on your previous system. As a result, the databases(s) and/or configuration files(s) may not be compatible.</div>

Refer to the '''INSTALLED APPS TAB''' section of the ''migration text'' to determine applications to install. Any [http://www.amahi.org/faq/if-i-pay-for-an-app-when-your-next-version-comes-out-do-i-have-to-pay-for-your-app-again previously purchased applications] from the [https://www.amahi.org/apps Amahi App Store] will be available for install.

* As you proceed to install applications, compare the version you install with the version listed in the ''migration text''. That will give you an indication if a database or configuration file restore will be successful.

* If you have any database(s) and configuration file(s) saved for applications, you can restore them in most cases. Database(s) can be restored via command line or using a MySQL application such as, [https://www.amahi.org/apps/adminer Adminer] or [https://www.amahi.org/apps/phpmyadmin phpMyAdmin].

* Obviously you don't have to install all the applications you had on the previous system and you can choose to install new ones as well.

:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">'''NOTE:''' You can now manually install any apps from sources other than the [https://www.amahi.org/apps Amahi App Store] if needed.</div>

== Migrate Settings ==
We are now ready to being updating the new HDA with our previous HDA settings. Start by selecting ''Setup'' from the Amahi Dashboard main page (<nowiki>http://hda</nowiki>).

* <u>'''Users Tab'''</u>
:Create ''New users''. Refer to '''USERS TAB''' section in the ''migration text''.

* <u>'''Shares Tab'''</u>
:Choose the appropriate section and complete as noted.
:*''Details'' section: Create ''Shares''. Refer to '''SHARES TAB''' section in the ''migration text''.
:*''Settings'' section. Update ''Work Group Name'' if needed. Refer to '''SETTINGS''' under the '''SHARES TAB''' section in the ''migration text''.

* <u>'''Network Tab'''</u>
:Choose the appropriate section and complete as noted.
:*''Fixed IPs'' section: Create ''Fixed IPs''. Refer to '''FIXED IP''' under the '''NETWORK TAB''' section in the ''migration text''.
:*''DNS Aliases'' section: Create ''DNS Aliases''. Refer to '''DNS ALIASES''' under the '''NETWORK TAB''' section in the ''migration text''.
:*''Settings'' section:
::*Disable ''DHCP Server'' and/or ''DNS Server'' if needed. Refer to '''DHCP/DNS SERVER''' under the '''NETWORK TAB''' section in the ''migration text''.
::*Update ''Lease Time'' if needed. Refer to '''DHCP Lease Time''' under the '''NETWORK TAB''' section in the ''migration text''.
::*Change ''DNS Provider'' if needed. Refer to '''DNS PROVIDER''' under the '''NETWORK TAB''' section in the ''migration text''.
::*Update ''Gateway'' if needed. Refer to '''GATEWAY''' under the '''NETWORK TAB''' section in the ''migration text''.

* <u>'''Settings Tab'''</u>
:Enable ''Advanced Settings'' and/or ''Guest Dashboard''. Refer to '''SETTINGS TAB''' section in the ''migration text''.

You should now have the majority of your settings restored. Double check to ensure you did not overlook anything before moving to the next section.

<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">'''NOTE:''' You can now make any manual configuration changes that are needed.</div>

== Setup Greyhole ==
If you do not want to use [https://wiki.amahi.org/index.php/Greyhole Greyhole], you can '''SKIP''' this section.

Otherwise install the [https://www.amahi.org/apps/greyhole-ui Greyhole UI] application. In the Amahi Dashboard, navigate to the '''Drive Pooling''' tab, choose:
* '''Partitions''' section and select the appropriate ''Locations'' for the ''Pool''. Refer to '''greyhole.conf''' section (''storage_pool_directory'' line) in the ''migration text'' to verify the correct partitions are chosen.

:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">'''NOTE:''' If [https://www.amahi.org/apps/greyhole-ui Greyhole UI] application was installed on your previous HDA, you should refer to '''DRIVE POOLING TAB''' section in the ''migration text'' rather than '''greyhole.conf''' section.</div>
* '''Shares''' section
** Choose ''Storage Pool'' for the applicable ''Shares''. Refer to '''greyhole.conf''' (''num_copies'' line) section in the ''migration text'' to verify the correct ''Shares'' are chosen.
** Select the appropriate ''Number Copies'' for ''Shares''. Refer to '''greyhole.conf''' section (''num_copies'' line) in the ''migration text'' to verify the correct ''Number Copies'' are chosen.

::<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">'''NOTE:''' If [https://www.amahi.org/apps/greyhole-ui Greyhole UI] application was installed on your previous HDA, you should refer to '''SHARES TAB''' (''Disk Pool Copies'' column) section in the ''migration text'' to determine the appropriate setting.</div>
[https://wiki.amahi.org/index.php/Greyhole#Greyhole_Advanced_Options Greyhole Advanced Options] are configured in ''greyhole.yml'' file (''/var/hda/platform/html/config''). Compare the contents with the '''greyhole.yml''' section in the ''migration text'' for any differences. Make changes as needed.

Before proceeding to the next section, verify Greyhole is working properly. This can be done by monitoring the log:
tail -f /var/log/grehole.log
If there is a problem, refer to [https://wiki.amahi.org/index.php/Greyhole_troubleshooting Greyhole Troubleshooting].

== Final Verification ==
All the settings and configuration changes from your previous HDA should now be complete. Recommend you verify that everything is working as desired. Its best to check things over thoroughly now to prevent an unexpected surprises later.

If something is not working as expected, double check ''migration text'' to ensure you didn't make any errors. Depending on the issue, you may need to refer to the [https://wiki.amahi.org/index.php/Troubleshooting Amahi Troubleshooting] guidance.

Providing there are no problems, you should now have a fully functional up-to-date Amahi HDA.

== Additional Tips ==
Each HDA is unique as will be the migration to a different Amahi supported OS. There are additional steps you can accomplish to make the transition a bit smoother.

Recommend backing up:
* App database(s) and configuration file(s)
* ''.bashrc'' and ''.vimrc'' files for each user
* User added terminal scripts
* Screen capture of dashboard tabs
12,424

edits