Backing Up FMYiRC: FMYiRC V1.20

From FMYiRCWiki

Jump to: navigation, search

Backing Up Freemed-YiRC: Freemed-YiRC V1.20


Contents



Summary

This article describes how to backup your Freemed-YiRC system. This article is geared specifically towards Freemed-YiRC V1.20, so some items may not work on versions prior to that. Additionally, these methods are likely to change in future versions of Freemed-YiRC.

The backup program does not back up the entire Freemed-YiRC server, i.e., the Operating System and all files. The backup program only backs up the Freemed-YiRC program and data files, as well as the Freemed-YiRC database. The rationale here is that by only backing up this data, backup files will be much much smaller. Additionally, much work and effort has been put into automating the installation of Linux via the use of the Helper CD. Installing Linux from scratch (if need be) and running the Helper CD is not a long nor a tedious process. Therefore it is fairly quick to get a server back up and running, or to get a new server loaded from scratch and running, by installing Linux from scratch, running the Helper CD, then restoring the backup files.


Important Notes

  • The backup mechanism in Freemed-YiRC V1.20 does not back up the contents of the /home/fmyirc-files nor the /home/fmyirc-filestorage directories. This will be fixed in an upcoming version of Freemed-YiRC.
  • After creating backup files, it is extremely important to get them moved to another location on (or off) the server! If they are kept in the same place they are created, they will be included in the next backup, which will cause the size of the backup files to increase dramatically in a short period of time. This will be fixed in an upcoming version of Freemed-YiRC.
  • There is currently no method of automatically backing up Freemed-YiRC. This can be accomplished on existing servers, however it is outside the scope of this document (consult your IT person(s) or Contact Me for consulting). This will be a new feature addition in an upcoming version of Freemed-YiRC.
  • The current method of backing up Freemed-YiRC is not web-based. It requires the ability to log into the server (either directly or via SSH). This is not likely to change. However, as noted above, the backup procedure itself may become automated, requiring only the process of copying the file off the server to be manual (IT people could automated this further, but that's beyond the scope of this document).
  • The backup files are not encrypted. Therefore it is important to protect them from getting into the hands of untrusted people. It is recommended to transfer them to a USB flash memory device, then place that device in a fire-rated safe. Preferably at an off-site location (i.e., at the IT administrator's or CEO's home). This way, if there is a catastrophe at the company (i.e., fire, etc...) the data has a higher chance of surviving and being able to be restored.


When to Backup

Backups should be performed once per week, at minimum. If your data is valuable to you (and it certainly should be), you should consider backing up your system on a daily basis!


What to do with Backup Files

Don't just leave them on the FMYiRC server to rot. If that machine goes down, that data may not be recoverable, and you've just defeated the purpose of backing up. These files should be transferred to one or more other trusted computers and/or storage devices. It is recommended to transfer them to a USB flash memory device, then place that device in a fire-rated safe. Preferably at an off-site location (i.e., at the IT administrator's or CEO's home). This way, if there is a catastrophe at the company (i.e., fire, etc...) the data has a higher chance of surviving and being able to be restored.


Creating a Backup

Logging In

To create a backup, you must first log into the FMYiRC server. There are two options for doing this:

  • Log in directly. I.e., at the monitor & keyboard on the server. Simply type in the root username ("root") and password to log in.
  • Using a program capable of establishing an SSH connection to the FMYiRC server.
    • On Linux, ssh can be used to establish a connection to the FMYiRC server. The command to do so (from another computer on the network, or from the Internet) would look similar to the following:
      • ssh USER@IP -p60022
        • Where:
          • USER is the username of a NON-ROOT user created during the Linux installation. You cannot log into a FMYiRC server as root from the network, this is a security feature. In the FMYiRC Linux installation guide, it was suggested you use a username of fmyirc.
          • IP is the IP address of the FMYiRC server. This IP address is likely the same IP address you use to access FMYiRC when using a web browser. However, you don't need the URL portions... i.e., you must not include the http:// portion nor anything that starts with a forward-slash ("/")... you must ONLY use the IP address portion of the URL... XXX.XXX.XXX.XXX.
    • On Windows the freely available PuTTY program can be used to access the FMYiRC server. See the above notes for Linux as to what to put in the username, password, and port fields.


Initiating a Backup

Once you're logged into the FMYiRC server, you need to follow these steps:

  • Firstly, unless you logged in as root directly on the server, you need to become the root user. To do so, issue the following command:
    • su
    • You will then be prompted for the root users password.
      • If it does not ask you for a password, then you are already logged in as the root user and can proceed.
  • Next, you need to navigate to the FMYiRC user directory:
    • cd /var/www/html/freemed-yirc
  • Then, you issue the command to backup the FMYiRC files.
    • ./fy_backup
      • Depending on how much data you have on your FMYiRC system, this can take anywhere from one to many minutes.
      • Also, depending upon the speed of your server (and if it is not multi-core), this may slow down access to FMYiRC while the backup program is running.
    • The backup program will not output anything to the screen unless there is an error. When the program is finished it will return you to the command prompt.
    • The backup program creates a log file, /tmp/fy_bkup_errorlog.log. This file can be viewed for troubleshooting purposes.


Accessing the Backup Files

After the backup program has finished running, the backup files will be available for downloading. This is not done via the ssh connection (but do not close that connection, as it will still be required for the next step - deleting the backup files).

To download the backup files to another computer (other than the server itself):

  • Pull up your Internet browser and use the following two URLs:
    • https://IP_ADDRESS/freemed-yirc/usr/fy_file_bkup_MMDDYYYY.tar.gz
    • https://IP_ADDRESS/freemed-yirc/usr/fy_data_bkup_MMDDYYYY.tar.gz
      • Where:
        • IP_ADDRESS - The IP address of the FMYiRC server. This is the same IP address you use to normally access the FMYiRC user interface.
        • MMDDYYYY - The month (two digit), day number (two digit), and year (four digit) of the the date the backup was created (i.e., today).
          • Example: 07042010 - July 4th 2010.
  • The first file (fy_file_bkup...) contains the program and data files for your FMYiRC installation.
  • The second file (fy_data_bkup...) contains the database data for your FMYiRC installation.


Deleting the Backup Files From the Server

Because the backup files are placed in the FMYiRC directory, if they are left there they will themselves be backed up during the next backup process, unless they are deleted. If you are still logged in via SSH as described in the previous sections, you can use the following command to delete the backup files. If you are no longer logged in, then follow the instructions in the previous sections to log in and then perform the following command.

rm -f /var/www/html/freemed-yirc/usr/fy_????_bkup_*.tar.gz
Personal tools