I moved my site from one server to another in the same way I moved another site. But it won't get out of maintenance mode.
I can access phpMyAdmin and I can access the server files easily.
I've tried /user
and /q=user
.
Any suggestions?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityThere is a few things you can try.
1. Using drush
Go to root of the website and run this drush commands one by one:
drush vset maintenance_mode 0
drush cc all
2. Using database query
Go to phpmyadmin and run this db statement in order to update the "maintenance_mode" property in the variable table to "i:0;":
UPDATE `variable` SET `value` = 'i:0;' WHERE `name` = 'maintenance_mode';
3. Login as admin programatically
Make copy of the index.php
file and call it what every want (maintenance.php
for example) and at the end of the file replace
menu_execute_active_handler();
with
global $user;
$user = user_load(1);
drupal_session_regenerate();
drupal_goto('user');
go to that file (like [your_website]/maintenance.php
), after that just disable maintenance mode and don't forget to remove this file after you finish.
4. Manually set maintenance_mode
variable in index.php
Edit index.php file and put
variable_set('maintenance_mode', 0);
just before
menu_execute_active_handler();
5. Configure maintenance mode in settings.php
file
At the end of your settings.php
file put
$conf['maintenance_mode'] = 0;
Just go to /user/login, it works even in maintenance mode, and then sign in as an admin.
Using Drush in D8, one can do:
drush state-set system.maintenance_mode 0
To turn maintenance mode back on:
drush state-set system.maintenance_mode 1
And you can also get out maintenance mode by admin/config/development/maintenance under the tab you can able enable or disabled it.
On Drupal 8
If your drush does not have access to mysql but you have access to mysql console you could try this
UPDATE `key_value` SET `value` = 'i:0;' WHERE `name` LIKE '%maintenance_mode%'
On Drupal 8.1.1 the following drush commands worked for me:
I've encountered the OP's issue after moving sites from one server to another, and it was because the database didn't fully import.
Compare the list of DB tables on the new server to the list of tables on the old server. If it's incomplete then it's likely you imported the DB through something like PHP MyAdmin and it wasn't fully imported.
You can import off the filesystem with mysql -u username -p dbname < filename.sql
, or try using a script like bigdump.php.
You could also try reducing the file size of the imported DB file. Either clean out junk data that you don't need, or export the DB to multiple files with a subset of the tables in each.
As of Drupal 9.3.15, go to http://example.com/user/login
And then go to Configuration -> Development -> Maintenance Mode and then uncheck "Put site into maintenance mode"
this has got to be the easiest solution.
but this only works if the user is enabled the "Use the site in maintenance mode". Which is found at Home->Administration->People->System->"Use the site in maintenance mode"