English Yacs handbook Stay tuned to your server

How to backup and restore the database?

With a simple click you can create a backup version of the database contents. Without another click you can restore data when necessary.

To do that visit the Control Panel and hit the Backup/restore link in the menu below the title. Of course, you have to be an authenticated associate to do that.

Returned backup data are files containing standard SQL-queries, that reconstruct the state of the database as it was when the backup was created.

It's strongly encouraged to take a backup regularly (weekly or so).

The restoring utility can actually process any set of SQL statements, as long as each statement ends with the character ';' (semicolon). Comment lines starting with the character '#' are also supported.

Therefore, you can use the restore facility as a convenient method to inject new records in your database.

If you are in trouble with your database, you can try one of following options.

[*] Option 1: If you have been authenticated as a valid associate, trigger this script manually from your web browser. Upload the backup file and let YACS process SQL statements.

[*] Option 2: When triggered, the script complains that you are not an associate. In this case, use your FTP account to delete the switch file, at the YACS installation directory. The file can have either the name switch.on or switch.off. Then restart the script to make it accept your upload request. On next click you may have a strange, but harmless, message from setup.php because it will automatically recreate switch.on.

[*] Option 3: Use phpMyAdmin, or an equivalent web-based interface to MySQL. Use your web browser to trigger phpMyAdmin, and use the backup file to setup and populate tables.

[*] Option 4: use MySQL directly. If you have a shell account, restoring a backup can be done by running the mysql program with the following arguments:

mysql -u username -p -h hostname databasename < backupfile.sql


In all cases, you should run the installation script after any restore, in order to recreate index files that are used by YACS to fasten access to data.