VMmanager OVZ database backup

From ISPWiki
Jump to: navigation, search

Making a database backup copy

Complete the following steps to make a backup copy of the VMmanager OVZ database.

1. Create a backup plan.

In "Data settings" select - "Databases".

2. You can select "Databases" later, when creating filters.

When creating a filter select "Databases" and select a required database (for VMmanager OVZ only the main database is available)

3. To make a database backup copy you need to start the plan that you have created, or it will be started automatically based on the corresponding cron job.

Recovering a database from the backup copy

There are two scenarios of database recovery:

1. VEmanager is started, you can access it through the web-interface. In this case you can restore a database in the same way as container.

2. VEmanager is not started. In this case complete the following steps:

  • find the archive of the database backup copy on your storage;
  • untar the file vemgr_db.sql
  • if the "vemgr" database is missing in mysql, you need to create it
  • Execute the following command to recover the structure and data:
mysql -u user -ppassword vemgr < vemgr_db.sql
  • start the function dbfix:
./sbin/mgrctl -m vemgr dbfix

if you are recovering from the VEmanager interface, the dbfix function will start automatically.

The dbfix function performs the following actions:

  • synchronizes the containers that were migrated - on each cluster node (the list of nodes is taken from the recovered database) the list of containers is requested; containers in the database will be updated according to that list.
  • deletes the containers that are not found on cluster nodes from the database.

New containers are not included into the database - you should import them with the function import.local.