> For the complete documentation index, see [llms.txt](https://documentation.atempo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.atempo.com/tina-4.9.5/tina-4.9.5-en/administration-guide/restore/mysql.md). Agents can also search and read this documentation through its [MCP server](https://documentation.atempo.com/~gitbook/mcp).

# MySQL

Tina for MySQL lets you restore all databases at once, or a single database at a time.\
The procedure for restoring MySQL databases is identical to any file or directory restore. See the [Tina Restore Documentation](https://documentation.atempo.com/tina-4.9.5/tina-4.9.5-en/tina-4.9.5-documentation.md) for instructions and information on restore operations, restoring a lost database, or a previous version of a database.

Tina performs cold restores of MySQL databases. All users must\
therefore be disconnected from a database in order to restore it.\
The first backup following a restore must be a full backup. See\
for more details.

## Restore to another database

You can restore a MySQL database to another database if it is located on the same server.

**To restore to another database**

1. Open the Restore and Archiving interface on the application to restore to another database.
2. In the file tree, open the Information node, right-click the environment variable <kbd>TINA\_MQL\_TARGET\_DB</kbd> and select Properties.
3. In the Value field of the variable editing window, enter the name of the destination database. Click **OK** to confirm your choices.
4. In the tree, select the database to restore.
5. Select **Tree > Selected Object > Versions.** The time versions window opens. It contains the list of backups.
6. Select the backup to restore from the list and click Synchronize. The tree is updated. The list of all objects required for the restore is displayed.

   > **Note**: Due to limitations of the <kbd>mysqlbinlog</kbd> tool, only a full backup can be restored to another database. If you select an incremental backup, the restore will be performed from the previous full backup, and the restore files will be kept. The following message will appear in the logs: "Recovery file restored to system temporary directory and will not be applied". You can then apply the restore files to the database manually (with or without modifications).

7\. Check the box next to the database to select it. This will automatically select all files required for the restore.

8\. Select **Restore > Run**. The restore window opens.

9\. Click **OK**. The database has been restored.

10. Once the restore is complete, delete the value you entered for the <kbd>TINA\_MQL\_TARGET\_DB.</kbd> variable

    > **Note**: When the <kbd>TINA\_MQL\_TARGET\_DB</kbd> variable is used, only one database can be restored per restore session.

### Point in time restore

Point in Time Recovery (PITR) is only available if binary logs are enabled on the MySQL server.\
When you request a point in time restore, Tina restores the database then applies the restore files up to the chosen date.

**Perform a point in time restore**

1. Open the Restore and Archiving interface on the application to restore to a point in time.
2. In the file tree, open the Information node, right-click the environment variable <kbd>TINA\_MQL\_PITR\_DATE</kbd> and select Properties.
3. In the Value field of the variable editing window, enter the restore date in the <kbd>yyyymmddhhmm</kbd> format. Click OK to confirm your choices.
4. In the tree, select the database to restore.
5. Select Tree Selected Object Versions. The time versions window opens. It contains the list of backups.
6. Select the backup to restore from the list and click Synchronize. The tree is updated. The list of all objects required for the restore is displayed.
7. Check the box next to the database to select it. This will automatically select all files required for the restore.
8. Select Restore Run. The restore window opens.
9. Click OK. The database has been restored.
10. Once the restore is complete, delete the value you entered for the <kbd>TINA\_MQL\_PITR\_DATE.</kbd> variable

### Restore to a directory

When you choose restore to a directory, Tina does not apply the content of the restored files to recreate the database at the end of the restore session. Instead, the restored files are kept in the directory of your choice.

Restore to a directory is useful if you want to modify the content of the SQL files before rebuilding the database, for example to delete data in the restored database or to modify the SQL commands to restore to a particular location.

With this feature, you can restore an incremental backup under a different name. Restore to a file, then modify the script to change the database name before manually applying the script using the <kbd>mysql</kbd> tool.

**Restore to a directory**

1. Open the Restore and Archiving interface on the application to restore to a directory.
2. In the file tree, open the Information node, right-click the environment variable <kbd>TINA\_MQL\_RESTORE\_TO\_FILE</kbd> and select Properties.
3. In the Value field of the variable editing window, enter the path of the directory where you want the files to be restored. Click OK to confirm your choices.

   > **Note**: Do not use the MySQL installation directory for this variable, otherwise the restored files will be seen as an actual database.
4. In the tree, select the database to restore.
5. Select **Tree > Selected Object > Versions.** The time versions window opens. It contains the list of backups.
6. Select the backup to restore from the list and click Synchronize. The tree is updated. The list of all objects required for the restore is displayed.
7. Check the box next to the database to select it. This will automatically select all files required for the restore.
8. Select **Restore > Run**. The restore window opens.
9. Click **OK**. The database has been restored.
10. Once the restore is complete, delete the value you entered for the <kbd>TINA\_MQL\_RESTORE\_TO\_FILE.</kbd> variable

## Restoring the mysql database

The <kbd>mysql</kbd> database contains system metadata about users, permissions, and databases. Given that the content of this database can have significant impacts, its restore must be performed carefully by the administrator. This database is restored as a <kbd>mysql.sql</kbd> file:

* In the directory defined by the <kbd>TINA\_MQL\_RESTORE\_TO\_FILE.</kbd> variable
* In the system temporary directory if the <kbd>TINA\_MQL\_RESTORE\_TO\_FILE</kbd> variable is not defined. Once the restore is complete, the administrator must check the content of this file before applying it with the <kbd>mysql</kbd> utility.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.atempo.com/tina-4.9.5/tina-4.9.5-en/administration-guide/restore/mysql.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
