Excuse me, everyone update the site (including the database) what is a process?

Source: Internet
Author: User
Recent updates to the project and database, if the changes are relatively large. So how do we do it?
For example
Do you want to stop the service before updating?
What are the issues to be aware of when updating?
How often is it better to update?
How will the database be updated? Because the local test data, and the server data is not the same. cannot be directly overwritten.
....
The younger brother has no actual experience, all is the comparative theory. We all know that a site database is the soul of the site, the wealth of enterprises. As long as there is a data problem, there can be troublesome consequences.
People who want to have experience, share a bit!!!

If you can talk about database backup, restore, database operation log generation, such as experience is better!

Thank you, first.


Reply to discussion (solution)

So ask very general, if you all the structure of the site and so on the database has changed, then directly back up the old site, the data into the new database and then directly deployed to publish the new site. If it is just a part, then look at the actual situation to deal with it ...

It is common practice to pause the service for a certain period of time and then do various data import and export replacement features page ...

Night Black and high stop service, it is possible AH! ~

1: Backup--
Updating the project and database must be done in advance.
2: Partial Update--
If a large part of the need to update, it is recommended to take the method of segmented update, small data volume after all easy to operate some
3: Database split operation--
The same principle, if there are a large number of update and delete operations, must be divided into a number of small to perform
Example code:
where (1) {
Delete 1000 strips at a time
mysql_query ("Delete from users where xx>0 limit 1000");
if (mysql_affected_rows==0)
Break
Take some time off.
Usleep (50000);
}

Thanks for the advice upstairs!

  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.