How to restore complete database keeping the site in maintenance mode in Drupal 7 I need to restore complete database in a regular basis (weekly). I am using pure PHP + system call to mysqldump and mysql to backup and restore full database. The restore process takes 2 minutes. What would be the correct procedure in order to keep the site in maintenance instead of getting a Drupal database error? Is there some sequence of table restoration?

For example, I use UPDATE variable SET value = 's:1:\"1\";' WHERE name= 'maintenance_mode';" just before the restoration, but obviously as there is a DROP TABLE if exists maintenance_mode in the SQL backup file, the site will show an error instead of the maintenance screen for a moment, and maybe in more occasions if there are incongruences among the different tables as they are updated.

I was thinking of controlling the process with the .htaccess, forwarding all traffic to a static HTML maintenance page.

Update: I have created my own module as there are many other tables which are outside Drupal and the product has to be specifically integrated with the requirements of the customer. So I cannot use the Backup and Migrate module (as suggested in one of the answers).
Add a maintenance-page--offline.tpl.php page to your theme , and whenever the connection to DB is lost drupal will show this page instead of an error , but designing this page you cant use formal variables which are used in theme like $title or $styles and ... cause these are stored in DB and in your situation there is no access to that , so you must add them using php or just implement some strings . 

Check this page for more help : Theming the Drupal maintenance page