More fixes

WordPress shows the install screen on a site that already exists

You open your site, or log in, and WordPress greets you with "Welcome to the famous five-minute WordPress installation process" or a language picker, as if the site had never been set up. Your posts are almost always still there. WordPress shows the install screen when it reaches the database but cannot find its own tables under the name it expects. Here is how to tell why, and the fix for each case.

What the owner sees

harborbakery.example/wp-admin/install.php

What the checks found


  

Do not click Install yet

Running the installer on a live site writes a fresh, empty site on top of your settings, and can leave you with two sets of tables. Close the tab and work out the cause first. It takes about ten minutes.

Find out which case it is

  1. Open wp-config.php and read $table_prefix. It is usually 'wp_', but many hosts and security plugins use something like 'wp8x2_'.
  2. Open the database in phpMyAdmin (or your host's database tool) and look at the table names. Is there a table called <prefix>options, for example wp_options or wp8x2_options?
  3. Prefix in the file and prefix on the tables differ? That is the cause in most cases, typically after a move, a restore, or a security plugin that renamed the tables.
  4. No WordPress tables at all in this database? DB_NAME in wp-config.php points at the wrong database (common after moving hosts, where the new database got a new name), or the import never finished.
  5. Tables are there, prefix matches, but <prefix>options is missing or empty? The options table was damaged or dropped. Check for a siteurl row in it.
  6. Did the screen appear right after a host move or a "migration" plugin? Note that, because it decides which backup you restore from.

The fixes, by case

  1. Prefix mismatch: set $table_prefix in wp-config.php to the prefix the tables actually use (keep the underscore). Reload the site. This alone fixes most cases.
  2. Wrong database: correct DB_NAME (and DB_USER, DB_PASSWORD, DB_HOST if they changed) to the database that holds your tables. Your host's database page lists the right names.
  3. Unfinished import: import the database export again, all of it. A large file often stops halfway through phpMyAdmin's upload limit; use the host's import tool, split the file, or ask the host to load it.
  4. Tables renamed by a security plugin, but some were missed: rename the strays to the same prefix, and make sure the wp_user_roles option and the wp_capabilities user meta keys carry the new prefix too, or you will log in with no admin rights.
  5. Damaged or missing options table: run a repair from phpMyAdmin first (select the table, Repair). If it is gone, restore just that table from your latest backup rather than the whole database.
  6. Nothing you have matches: restore the most recent full backup from your host's backup page. Most managed hosts keep daily copies for 14 to 30 days.

What you see, what it means, what it needs

What you seeWhat it meansUsual fix
Install screen; tables use a different prefixwp-config.php names the wrong prefixSet $table_prefix to the tables' prefix
Install screen; database has no WordPress tablesDB_NAME points at an empty databasePoint wp-config.php at the right database
Install screen after a move; only some tables presentThe import stopped partwayRe-import the full export
Site loads, but "Sorry, you are not allowed" in adminPrefix changed, role keys did notRename wp_user_roles and wp_capabilities keys
Install screen; options table missing or emptyOptions table damaged or droppedRepair it, or restore that one table

What not to do

Most cases are one line in wp-config.php. If your posts still do not come back, that is what the box below is for. Related: "Error establishing a database connection", Database update loop, Lost admin access, "Sorry, you are not allowed to access this page".