Manual Database Backup
From TBwiki
(Difference between revisions)
Cboulanger (Talk | contribs) m (Added a note about the name of the DB in later releases) |
(Updated for new format of database name) |
||
Line 1: | Line 1: | ||
− | To backup the MySQL database, use the following commands: | + | To backup the MySQL database, use the following commands (example is for major version 3.1): |
− | <pre>mysqldump -u tbdb -ptbdbpw --opt | + | <pre>mysqldump -u tbdb -ptbdbpw --opt toolpack_3_1 > toolpack_3_1_bk.sql</pre> |
− | Then, you need to save the " | + | Then, you need to save the "toolpack_3_1_bk.sql" file in a safe place. |
You can recover the database this way: | You can recover the database this way: | ||
− | <pre>mysql -u tbdb -ptbdbpw | + | <pre>mysql -u tbdb -ptbdbpw toolpack_3_1 < toolpack_3_1_bk.sql</pre> |
This procedure can also be used to make copies of similar configurations from one Toolpack system to another. The Serial Number of the Tmedia used must be updated after the new database is in place using the Migration tab. If the tab is not present, you can do it manually (contact support)<br><br> | This procedure can also be used to make copies of similar configurations from one Toolpack system to another. The Serial Number of the Tmedia used must be updated after the new database is in place using the Migration tab. If the tab is not present, you can do it manually (contact support)<br><br> | ||
Here are other useful mysql commands: | Here are other useful mysql commands: | ||
<pre>mysql –u tbdb –p tbdbpw | <pre>mysql –u tbdb –p tbdbpw | ||
− | use | + | use toolpack_3_1; |
show tables; | show tables; | ||
SELECT * from system_infos; | SELECT * from system_infos; | ||
Line 18: | Line 18: | ||
ps -ef | grep mysqld | ps -ef | grep mysqld | ||
</pre> | </pre> | ||
− | |||
− | |||
− |
Revision as of 08:12, 19 March 2021
To backup the MySQL database, use the following commands (example is for major version 3.1):
mysqldump -u tbdb -ptbdbpw --opt toolpack_3_1 > toolpack_3_1_bk.sql
Then, you need to save the "toolpack_3_1_bk.sql" file in a safe place.
You can recover the database this way:
mysql -u tbdb -ptbdbpw toolpack_3_1 < toolpack_3_1_bk.sql
This procedure can also be used to make copies of similar configurations from one Toolpack system to another. The Serial Number of the Tmedia used must be updated after the new database is in place using the Migration tab. If the tab is not present, you can do it manually (contact support)
Here are other useful mysql commands:
mysql –u tbdb –p tbdbpw use toolpack_3_1; show tables; SELECT * from system_infos; SELECT * from mysql.user;
And to work with the MySQL service:
service mysqld stop service mysqld start ps -ef | grep mysqld