What is the process for updating websites (including databases? -Php Tutorial

Source: Internet
Author: User
What is the process for updating websites (including databases? The project and database need to be updated recently. if the changes are large. So how to operate it?
For example
Do I need to stop the service before the update?
What should I pay attention to during the update process?
How often is the update better?
How to update the database? Because the local test data is different from the server data. It is impossible to directly overwrite data.
....
The younger brother has no practical experience and is more theoretical. As we all know, the database of a site is the soul of the site and the fortune of the enterprise. Any data issue may cause troublesome consequences.
I hope to share with experienced people !!!

If you can talk about database backup, restoration, database operation log generation, and other experience, it would be better!

Thank you.


Reply to discussion (solution)

This is a general question. If the architecture of your website changes with the database structure, you can back up the old site, import data to a new database and then directly deploy and release a new website. If it is just a part, let's take a look at the actual situation...

The common practice is to suspend the service for a certain period of time, and then perform various data import, export, and replacement functions...

It's still possible to stop services in the dark wind! ~

1: Backup --
To update projects and databases, you must back up the data in advance.
2: partial update --
If a large part of data needs to be updated, we recommend that you use the multipart update method. after all, it is easier to operate on small data volumes.
3: database segmentation --
The principle is the same as above. if there are a large number of update and delete operations, they must be divided into several small parts for execution.
Sample code:
Where (1 ){
// Delete 1000 entries each time
Mysql_query ("delete from users where xx> 0 limit 1000 ");
If (mysql_affected_rows = 0)
Break;
// Rest for a period of time
Usleep (50000 );
}

Thank you for your suggestions!

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.