Backing Up Your Database

Are you new to the eduTrac SIS online user's manual? If so, click here for a starting point. If you are looking for technical documentation, then check out the Wiki.

 

Below are instructions for manually backing up your database.

Using phpMyAdmin

Most servers have phpMyAdmin installed. If you have it installed and is accessible via the browser, log into phpMyAdmin, click Databases and select the database where eduTrac SIS tables are installed. When you do so, you should see all the tables in this database.

  • At the very top (see figure 1), you should see the Export link. Click the Export link to begin the export process.
  • phpmyadmin-export
    Figure 1
  • After you click the Export link, you will be redirected to the export page. The first option on the page is Export Method. Choose, Custom – display all possible options.
  • Next under Output, it should default to Save output to a file. If not, then choose the option.
  • Next under Format-specific options, the following should be checked: Disable foreign key checks and structure and data.
  • Under the next section entitled Object creation options, it should look like the screenshot below.phpmyadmin-oco
  • The last section on this page is entitled, Data creation options. It should look like the screenshot below.phpmyadmin-dco

Once everything is as specified above, click the Go button at the bottom left of the page to export your database. Save the file to a place on your computer where it will be easily accessible.

Using Command Line

  • The other option for backing up a database is to create a Mysql dump via command line. Create a shell session to your server. Once you are logged in, use the following structure for your command:
[mysql dump command] [mysql user command] [mysql user] [mysql user password command] [eduTrac SIS database] [direction sign] [database file name]
  • Following the example above, your dump command will look similar to the command below: root is the user and etsis is the database name.
mysqldump -u root -p etsis > etsis.sql

When you run the above command, you will see the Enter Password prompt. Enter the MySQL user’s password. If it is correct, then you will see the *.sql dump file in your file list. Now, make sure to move this file to a secure location.

Automatic DB Backups

etSIS runs database backups automatically. The cronjob handler gets called once a day around 12:00 AM. However, feel free to deactivate this cronjob handler from running and use some other method for creating database backups of your data. If you choose to not deactivate this cronjob handler, below are a few filters you should be aware of.

db_table_no_data – There is an option to dump tables without data. As an example, two tables you may want to add are error and activity_log table. Both tables may get quite large at times and there would be no need or reason to dump/save their data. The default option is that the structure and data for all tables are included in the backup. To dump a particular table or tables without their data, you will need to call the filter like so:

/**
 * Exclude dumping the data of the error and activity_log
 * tables.
 */
function exclude_db_table_data()
{
    $array = ['error', 'activity_log'];
    return $array;
}
$app->hook->add_filter('db_table_no_data', 'exclude_db_table_data');

backup_database – This filter handles the rotation of mysql dump files saved. The default is that the system will delete anything older than 10 days. If you want to extend the length, call the filter like so:

/**
 * Deletes database backups older than 20 days old.
 */
$app->hook->add_filter('backup_database', 20 * 24 * 3600);

Automatic System Backups

Just like database backups, etSIS also backs up your system files automatically as well. Please note that this does not include cache or node files. Similar to database backups, any system backups that are older than 10 days old, will be removed. To extend it, call the filter like so:

/**
 * Deletes system backups older than 20 days old.
 */
$app->hook->add_filter('backup_system', 20 * 24 * 3600);

The location of where all backups are saved is based on this configuration:

$app->config('file.savepath') . 'backups' . DS

You might have tweaked that a bit based on the installation instructions.

Last Modified: Jun 19, 2017 @ 7:26 PM

Was this article helpful?

Related Articles

You must be logged in to reply to this topic.