Discuz! Provides powerful database management functions for webmasters, such as database backup, recovery, upgrade, optimization, and verification with one click. Webmasters with advanced technologies can perform advanced database operations by upgrading the database. The following describes how to use this function in detail. Operation path: [background] Discuz! Provides powerful database management functions for webmasters, such as database backup, recovery, upgrade, optimization, and verification with one click. Webmasters with advanced technologies can perform advanced database operations by upgrading the database. The following describes how to use this function in detail.
Operation path: [background] => [webmaster] => [database]
I. backup
Including backup Discuz! Data and UCenter data and custom backup.
1. backup Discuz! And UCenter data
The database backup interface appears. The" Discuz! And UCenter dataClick submit to back up all the site data.
If you are an advanced user, you can click "more options" to customize the backup method you need. As shown in:
The default database backup mode is Discuz! Backup by volume-file length limit (kb) ", initialized to 2048kb (2 MB)
Extended Insert-incremental backup is used. the default value is No.
Table creation statement format-use the default format, that is, the default format of MySQL. If you are migrating, you can select the MySQL version of the new server.
Mandatory character set-optional. if you want to back up a forum for transcoding, you need to select the corresponding character set.
Hexadecimal mode-default value: Yes. The hexadecimal mode ensures the integrity of the backup data, but the backup file occupies more space.
Compress the backup file. by default, the backup file is not compressed, which increases the execution speed of the backup program.
Backup file name-you can customize the file name to be backed up, with the suffix. SQL.
After the backup is successful, the following message is displayed:
2. Custom backup
You can select some data tables for backup or all data tables for backup.
3. backup data storage directory
The Directory for storing the backup data backed up in the UCenter background is as follows:
UCenter backup data storage directory: taking an independent host as an example, the UCenter installation root directory/data/backup _ date_random letter/Directory
Discuz! Backup data storage directory: take the independent host as an example, Discuz! Install the root directory/data/backup _ date_random letter/Directory
4. Notes
1) if the site is migrated, note that the new virtual host must support the PHP + MySQL environment; otherwise, the site cannot run normally after migration; make sure that the MySQL version and character set of the new virtual host are consistent with those of the original virtual space (MySQL version is separated by 4.0 and 4.1). Otherwise, the site may be garbled after recovery.
2) If you have installed the plug-in, we recommend that you back up all directories and files except the config directory.
In addition to backing up the forum background, if it is an independent host, you can also directly package the Database Directory for backup, or use phpMyAdmin for backup.
II. recovery
Close the site before you perform the restoration operation. after the recovery is complete, the site can be reopened.
Shows how to restore the backed up data to the site:
This function overwrites the original data while restoring the backup data.
Before restoring data, please go to Discuz! Find the restore. php file in the utility folder under the X2.5 installation file directory, and upload the restore. php file to the data directory of the program folder. To ensure the security of your site, you must delete the restore. php file in time after data is successfully restored. this method is suitable for restoring multiple backup files.
Run http: // www. Discuz. Net/data/restore. php restore data
The page will automatically refresh the backup file in the backup data directory of the server. you can also click "import" on the right to restore data. The data recovery time depends on the volume of data backed up by the site and the number of data files.
Note: The data recovery function can only be restored by the current version Discuz! The exported data file may not be recognized by other software export formats.
III. upgrade
By default, SQL statements are not allowed to run on the site. when you enter the database upgrade page, you find that the function is unavailable. Go to the server root directory (FTP file root directory) where the site is located, find the config/config_global.php file, and change $ _ config [admincp] [runquery] to 1, refresh the background page to go to the database upgrade page.
The database upgrade interface is shown in:
The database upgrade page provides two methods for the webmaster to choose from. one is the packaged upgrade statement "commonly used SQL upgrade statements", which is the fastest way to complete the required functions. To expand the packaging statement, modify/source/admincp/admincp_quickquery.php to add common SQL operations for function expansion. By default, 14 common SQL upgrade statements are added.
The second is to directly enter the database upgrade statement, such as the upgrade statement:
Insert into pre_common_syscache (cname, ctype, dateline, data) VALUES ('test', '1', 13312341234, 'test ')
"Insert a test data"
Write the statement and click submit below. After modification, we recommend that you update the system cache. IV. Optimization
Like a computer operating system, Discuz! The database fragment function is also available. Data Table optimization can remove fragments from data files, so that records are arranged closely and read/write speeds are improved.
To select the data table to be optimized, you only need to click the "submit" button to let the program optimize the data fragmentation in the database.
V. verification
There is only one button on this page;
Click to verify the database. When Discuz appears! The default database structure is different from the structure of the current running site, which is listed here and the repair button is provided. As shown in:
You can repair the modified fields and missing forum settings here.
Note: 1. database verification only applies to Discuz! Check the database structure officially released. 2. this tool only performs a simple check on the field modification and missing, and does not process the missing index.
Through the above instructions, webmaster friends have been skilled in database backup, recovery, optimization, and validation. Through the study of SQL statements, you will soon master the advanced "upgrade" function.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service