77

Here's my situation. I have followed the exact instructions on wordpress codex page about moving a site to another server. Here are the step's i have taken.

  1. Export a copy of my database
  2. Make a new database in the new server
  3. Import the database I exported earlier
  4. Upload a copy of my Wordpress files via Ftp
  5. Use this script to change all my local url's to new one's
  6. Make changes to my wp-config.php file according to the new server(I did not forget table prefix. Although it has some uppercase characters in it )

And then when I try to open my site on the new location it just directs me to wp-admin/install.php Now just to make the scenario clearer: The destination folder(on live server) is a sub directori in a public_html folder which already has another wordpress install inside it(I'm saying this just in case it should matter)

My .htaccess looks like this

    # BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subDirectoryName/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /subDirectoryName/index.php [L]
</IfModule>

# END WordPress

I have tried checking and repairing my tables via phpMyadmin but everything seems to be ok there and has no effect on the problem.

I also tried emptying the database on the live server and go through with the install. And it installs with no problems and everything works fine but, well I have no use for another clean install. But I think this at least rules out any trouble with wp-config file. I'm using Wordpress Version 3.3.1

So I guess the big question I'm left with is: Why isn't wordpress recognizing my Install after migration?

Any help much appreciated!

Hiilo
  • 2,381
  • 2
  • 15
  • 14

18 Answers18

144

Well finally I have solved the problem. And surprise, surprise It was the freaking UPPERCASE letter in my table prefix. I had it this way in my wp-config file wp_C5n but for some reason most of the tables got a prefix wp_c5n. But not all. So what id did was I changed my table prefix in wp_config file to all lowercase and then went through all the tables by hand via phpMyadmin to see If there's any uppercase tables left. There where about 3. They were inside usermeta table and inside options table. Now finally everything is working. Did a quick search through wordpress codex but did not find anything mentioning not to use uppercase characters.

Hiilo
  • 2,381
  • 2
  • 15
  • 14
  • 1
    really helpful point, why the plugins generate uppercase letter ?! – Mohamad Ali Apr 22 '15 at 10:35
  • 1
    I've been running Wordpress sites for years and never experienced this until today and sure enough I put capital letters in the database tables prefix name. Can't believe it. Thanks for your answer :+1: – MitchellK Nov 28 '17 at 11:53
  • 1
    Yes, was the uppercase. My host changes the prefix to lowercase automatically. Thanks your post! – Diego Somar Jan 12 '18 at 21:18
  • 1
    really helpful answer. My situation was a bit different but this led me to check the prefix and sure enough, I had a typo. ++ – Ian Mone Apr 07 '20 at 16:50
  • Mine was a simple error too, I was actually editing the "wp-config-sample.php" instead of "wp-config.php" I didnt even knew there was a sample config file. – maiakd Oct 18 '22 at 07:06
  • In my case, in addition to fixing the capital letter issue in the wp-config.php, I had to also run search and replace for the prefix (`cqf8K_` to `cqf8k`) on the entire database. One change in `options` and 6 in `user_meta` tables. Thanks a lot! – Miro Jan 12 '23 at 00:47
18

I experienced the same issue as the OP - Wordpress keeps redirecting to install-php after migration.

Problem was my database tables are named as prefix_tablename and I missed the underscore from $table_prefix in wp-config.

$table_prefix = 'myprefix';

should have been

$table_prefix = 'myprefix_';

chris.dempsey
  • 363
  • 5
  • 10
  • 1
    Also good to notice, sometimes when moving your db files your prefix can change from lower and uppercases, to only lowercases. The prefix is case sensitive. – Arno Tenkink Jan 05 '20 at 23:40
  • Saved my life, dont think that but is obviously, thank you! – Slvr Mar 14 '21 at 07:59
  • Well I changed my table prefix and it no longer goes to the install but now it redirects to the subdomain site I am migrating from. – Sam Aug 30 '21 at 11:50
17

Resolved: wp-config.php setting

I had a similar problem. I got the install.php after moving files and creating a new database. It seems the install screen shows up it there is problem finding the correct database tables.

I fixed the problem by changing the following settings to be correct:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'HikeforLife_dev11');

/** MySQL database username */
define('DB_USER', 'HikeforLife_dev11');

$table_prefix  = 'wphk_';
WebPro
  • 171
  • 1
  • 2
  • Thank you WebPro! I was brought in on a Wordpress site that suddenly had a blank config.php file and the table prefix was the one thing I rebuilt incorrectly. Matched it to the actual table prefix and it stopped redirecting to the install. Saved me a long headache. – Twitch Jan 24 '19 at 00:14
11

I would check two things:

  • First, I would check the url that is configured in the database. Check the wp_options table and the values of the "siteurl" and "home" options, it is possible that you need to update them if your domain has changed.

  • Another option is that your Apache server could not get the .htaccess. Check if the "AllowOverride" option is "all" in the httpd.conf file.

I hope it helps.

Beltran
  • 1,150
  • 6
  • 10
  • hmmm... siteurl is fine. I even copied the url from the wp_options table when did the clean install. So sadly that's not the problem. About the httpd.conf file. I'm not sure I have access to that. But when I was testing with the clean install I tried deleting .htaccess file and updating permalinks to see what kind of .htaccess file wordpress would generate and it generated the one I posted above. – Hiilo Mar 22 '12 at 18:22
  • This helped me. Now I can log in. And go to the landing page. But all my other pages say 404 not found. – Sam Aug 30 '21 at 11:59
8

I experienced a similar issue. None of the suggestions above helped me, though.

Eventually I realized that the Wordpress MySQL-user on my production environment had not been assigned sufficient privileges.

zkwsk
  • 1,960
  • 4
  • 26
  • 34
3

As I was trying to install server setup to localhost, I have configured the config file as well as DB in local host- I was redirected to the install.php.

wp

Check:1 Go to yourTableName_options Move to 'option_id'- '1' Change 'yousite url' to 'localhost/youLocalSiteFolderName'

Move to 'option_id' - '37' Change homw value to 'localhost/youLocalSiteFolderName'

Check:2 Move to 'wp_config' file check : $table_prefix = 'yourNew_Prefix_';

Hope it will help

Ran
  • 31
  • 3
3

Don't forget also the table prefixes if you installation don't use the default prefix.

Martin Tonev
  • 747
  • 12
  • 21
2

This happened to me after I copy migrated an existing website to WP Engine and forgot to do one thing required by WP Engine:

Update the WordPress core installation of the site that is being copied to the latest version.

So here was the problem then:

My old site that I was copying from another server to WP Engine had version 4.0. However, when you copy an existing site to WP Engine, you don't copy the WordPress core files, you only copy the contents of wp-content and the state (or snapshot) of the existing database. So the state of the database for my existing site was for an installation running WP 4.0. Nevertheless, when you create a new WordPress install on WP Engine, that install is created with the latest version of WordPress, which, at the time happened to be version 4.0.1, so that means the core files on the destination (WP Engine) were for a 4.0.1 installation but the database snapshot I was gonna import into WP Engine was for version 4.0. So when I overwrote the default WP Engine database with the import of the copy the database of my old site, I got the redirection error to the install script.

So to fix it, I just logged into the WordPress admin site of the site on WP Engine, made sure to reset the file permissions (by clicking the blue button), which, you sometimes have to do on WP Engine, and then re-installed the WordPress core, which, basically updates your database so that internally the db state was for a WordPress 4.0.1 install and the core files also match the version.

Took me a while to figure out what was going on.

racl101
  • 3,760
  • 4
  • 34
  • 33
2

I had the same problem and I fixed it by changing the database user privileges to full read & write.

Spacer
  • 21
  • 3
2

I experienced this issue today and started searching on internet. In my case there was no table in my DB. I forgot to import the tables on the online server. I did it and all works fine.

DOUMBIA Mamadou
  • 276
  • 2
  • 10
2

It seems that in general, this happens when Wordpress doesn't find the site information in the expected places (tables) in the database. It thinks no site has been created yet, so it starts going through the installation process.

This situation means that:

  1. Wordpress WAS ABLE to connect to a database. If it didn't, it would say there was an error and refuse to install or do anything else

AND

  1. it didn't find the things it was looking for in the expected places in the database it connected to.

Just to be clear, both 1) and 2) are happening when you see this symptom.

Possible causes:

  • Wrong database. You're working on several projects and you copied and pasted wrong database name, database host, or table prefix to the wp-config file. So now, you're unwittingly destroying ANOTHER client's website while agonizing over why isn't THIS website working at all.

  • Wrong database prefix. You can put several Wordpress sites in one database by using different prefixes for each. Make sure the tables in the database have the same prefixes as you entered in your wp-config. So, if wp-config says: $table_prefix = 'wp_'; Check that the tables in your database are called "wp_options", etc. and not "WP_options", "mysite_options" or something like that.

  • The data in the database is corrupted. Maybe you messed up while importing the sql dump, you imported a truncated file, a file belonging to some other project, or whatever.

eltomito
  • 280
  • 1
  • 8
  • I'm still working through debugging an issue like this, but this already helped me a lot -- specifically the inaccurate table prefix...for some reason was set differently in wp-config than that used in mysql tables. Thanks so much! – twknab Jun 25 '21 at 18:06
1

I tried all of these solutions before I realized that I had enabled opcache in PHP on my live environment. Wordpress was not reading a cached version of wp-config.

Andy
  • 2,095
  • 1
  • 29
  • 59
1

I got this problem when I used br tag in single product page of woocommerce. I was trying to edit the template that suddenly everything ... . that was a nightmare. My customer could kill me. try not to use this br tag anywhere.

Mohsen35
  • 155
  • 8
1

There can be many causes to this problem.

My suggestion is to turn on WP_DEBUG in wp-config.php

define('WP_DEBUG', true);
Paul Verschoor
  • 1,479
  • 1
  • 14
  • 27
1

This happens due to the following issues:

  1. Missing Files
  2. Database Connection Details Problem
  3. Site URL Issue
  4. .htaccess File Issue
  5. Webserver Failure
  6. Resources Blocked by Plugin
  7. Query Limit Exceeded
  8. Insufficient Database Privileges
  9. PHP Extensions

Reference: https://www.scratchcode.io/wordpress-keeps-redirecting-to-wp-admin-install-php/

Mayank Dudakiya
  • 3,635
  • 35
  • 35
  • This answer is just plain wrong. None of these things will cause the issue described in the original question. – eltomito Jun 26 '21 at 20:47
  • @eltomito I was facing the same issue and resolved using the second point which is "Database connection details problem". – Mayank Dudakiya Jun 27 '21 at 06:11
  • 1
    Could you be maybe more specific in the description? Because database connection detail problem sounds really vague to me. – eltomito Jun 28 '21 at 23:17
  • @eltomito Will do – Mayank Dudakiya Jun 29 '21 at 06:03
  • Actually, something like #2 was giving me an Unable to connect to database error, so much so that I had to create a new db and user, and just proceed with the install. I don't consider reinstalling a solution, but I must have mucked up my MySQL instance when I reinstalled XAMPP. – TARKUS Mar 14 '22 at 10:12
1

fellows!

In my case the problem was different. I had just to fix two things in wpconfig.php.

The $table_prefix = 'wpxx_' and the DB_HOST', 'mysql.hostinger.com' were wrong.

Hope it can help some people!

Fellipe Tavares
  • 106
  • 1
  • 6
0

In my case I had made a post on my website and added the post link to a button. Later I updated the post's title and link but kept the old link for the button which led to this error.

To solve this: I went to the database from my dashboard, found a table named wp_posts and deleted recent entries of my posts.

Shardul Birje
  • 341
  • 5
  • 14
0

In my case after restoring the database and wp-content folder, my home pag was redirected to wp-admin/install.php. If I login from that page it was fine but as soon as I log out, my home page was redirected to wp-admin/install.php

I deleted the caches:

  1. Nginx: rm -rf /var/www/cache/*
  2. Plugin: rm -rf /var/www/html/wp-content/cache/*
  3. Purged the cache on cloudflare for the domain

And the error was gone.